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


Variable Index

 o cipherName
 o clientID
client's ID
 o clientSk
client's Private key, will be stored in the file system, will be readable by packages with certain privileges
 o clientSkFile
Stores the path of client's secret key
 o keyPairName
 o rsa
Cipher class we use
 o serverID
server's ID
 o serverPk
server's Public Key, received at the time of registration of package
 o strength

Constructor Index

 o 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

Method Index

 o getCryptedStream(Object)
 o getDecryptedObject(byte[])
 o getObjectInputStream(byte[])
 o 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

Variables

 o keyPairName
 public static final String keyPairName
 o cipherName
 public static final String cipherName
 o clientSkFile
 public String clientSkFile
Stores the path of client's secret key

 o strength
 public static final int strength
 o serverPk
 protected PublicKey serverPk
server's Public Key, received at the time of registration of package

 o clientSk
 protected PrivateKey clientSk
client's Private key, will be stored in the file system, will be readable by packages with certain privileges

 o clientID
 protected String clientID
client's ID

 o rsa
 protected Cipher rsa
Cipher class we use

 o serverID
 protected String serverID
server's ID

Constructors

 o 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

Methods

 o getObjectInputStream
 protected static ObjectInputStream getObjectInputStream(byte inbuf[]) throws IOException
 o getCryptedStream
 public byte[] getCryptedStream(Object ob) throws Exception
 o getDecryptedObject
 public Object getDecryptedObject(byte mes[]) throws Exception
 o 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