Class CipherClient
java.lang.Object
|
+----CipherClient
- public class CipherClient
- extends Object
Client does not maintain persistent connection with SeSe,
so the protocol goes something like I send to the server
ApplicationID, Object crypted with server's public key
when I receive the Object I decrypt it, using the client's
private key, and get the Server dummy ID ( for the sake of
maintaining consistency ), and the return Object, at the
time of application registration, the client generates the
key pair keeps the private key with it self and broadcasts
public key to the server, now the applications which have
access to this particular key, and know the application
registration id will be able to submit the requests, and
receive replies.
clientsk refers to the client's secret key
serverpk refers to the server's public key
-
cipherName
-
-
clientID
-
client's ID
-
clientSk
-
client's Private key, will be stored in the file system, will be
readable by packages with certain privileges
-
clientSkFile
-
Stores the path of client's secret key
-
keyPairName
-
-
rsa
- Cipher class we use
-
serverID
-
server's ID
-
serverPk
-
server's Public Key, received at the time of registration of package
-
strength
-
-
CipherClient(String, String, String)
- takes clientID, clientSkFile as a parameter, and loads the client's
secret key and server public key from the given files
-
getCryptedStream(Object)
-
-
getDecryptedObject(byte[])
-
-
getObjectInputStream(byte[])
-
-
main(String[])
-
Generates the private key and the public key for the client and stores them in file
clientSecretKey, and clientPublicKey
clientPublicKey is uploaded to the server
while clientSecretKey is stored in the file system at some secure place
keyPairName
public static final String keyPairName
cipherName
public static final String cipherName
clientSkFile
public String clientSkFile
- Stores the path of client's secret key
strength
public static final int strength
serverPk
protected PublicKey serverPk
- server's Public Key, received at the time of registration of package
clientSk
protected PrivateKey clientSk
- client's Private key, will be stored in the file system, will be
readable by packages with certain privileges
clientID
protected String clientID
- client's ID
rsa
protected Cipher rsa
- Cipher class we use
serverID
protected String serverID
- server's ID
CipherClient
public CipherClient(String clientID,
String clientSkFile,
String serverPkFile) throws FileNotFoundException, SecurityException
- takes clientID, clientSkFile as a parameter, and loads the client's
secret key and server public key from the given files
getObjectInputStream
protected static ObjectInputStream getObjectInputStream(byte inbuf[]) throws IOException
getCryptedStream
public byte[] getCryptedStream(Object ob) throws Exception
getDecryptedObject
public Object getDecryptedObject(byte mes[]) throws Exception
main
public static void main(String args[])
- Generates the private key and the public key for the client and stores them in file
clientSecretKey, and clientPublicKey
clientPublicKey is uploaded to the server
while clientSecretKey is stored in the file system at some secure place