package de.uni.trier.infsec.functionalities.pki.real;

import de.uni.trier.infsec.lib.network.NetworkError;


public interface PKIServerInterface {
	
	public static final byte[] MSG_GET_PUBLIC_KEY	  = new byte[]{0x08, 0x0F, 0x0D, 0x0E}; 
	public static final byte[] MSG_REGISTER 		  = new byte[]{0x07, 0x0F, 0x0D, 0x0E};
	public static final byte[] MSG_ERROR_REGISTRATION = new byte[]{0x06, 0x0F, 0x0D, 0x0E};
	
	public SignedMessage register(int id, byte[] pubKey) throws NetworkError;
	public SignedMessage getPublicKey(int id) throws NetworkError;
	public void test();
}

@@ -142,16 +142,18 @@
 face %7B%0A%09
+/*
 %0A%09public
@@ -567,10 +567,453 @@
 test();%0A
+%09*/%0A%0A%09// TODO: I would like this interface to contain only those two methods.%0A%09// The local implementation is straightforward. The remote implementation %0A%09// needs to parse messages and check authentication.%0A%09%0A%09// throws PKIError if the id has been already claimed.  %0A%09void register(int id, byte%5B%5D pubKey) throws PKIError, NetworkError;%0A%09%0A%09// throws PKIError if id is not registered%0A%09byte%5B%5D getPublicKey(int id) throws PKIError, NetworkError;%0A
 %7D%0A

change PKIServerInterface