Class CipherServer
java.lang.Object
|
+----CipherServer
- public class CipherServer
- extends Object
Architecture client maintains a private key clientsk and we
have the the public key of the client at our end, we decrypt
the Message with the private key of Server, and crypt the
outgoing message with the public key of the client, the public
key is chosen according to the clientID of application
-
cipherName
-
-
clientID
-
-
clientPk
-
-
conn
-
-
keyPairName
-
-
rsa
-
-
serverID
-
-
serverSk
-
-
strength
-
-
CipherServer(String)
- Loads the server secret key.
-
getCryptedStream(Object)
- Takes an object, serializes it and returns a byte array crypted by
the client's public key.
-
getDecryptedObject(HttpServletRequest)
- This Method decrypts the request stream using the server's secret key,
deserializes it and returns an object associated with it
-
getLogin()
-
-
getObjectInputStream(byte[])
-
-
loadClientDBPk()
- This method loads Client Public Key from Database
-
loadClientPk()
- This method loads Client PublicKey from the file system
-
main(String[])
- On command line invocation creates server public key and server
private key.Server Public key should be accessible to application
developers from the servers site.And private key should be stored
securely.
-
putClientPublicKey(PrintWriter, String, byte[])
- This method when given a public key for a client as a byte array
puts it into the Server Database as a Binary Large Object( blob)
serverID
protected static final String serverID
keyPairName
protected static final String keyPairName
cipherName
protected static final String cipherName
strength
protected static final int strength
conn
protected static Connection conn
clientID
public String clientID
rsa
protected Cipher rsa
clientPk
protected PublicKey clientPk
serverSk
protected PrivateKey serverSk
CipherServer
public CipherServer(String serverSkFile)
- Loads the server secret key.
getObjectInputStream
protected static ObjectInputStream getObjectInputStream(byte inbuf[]) throws IOException
loadClientDBPk
public boolean loadClientDBPk()
- This method loads Client Public Key from Database
loadClientPk
public boolean loadClientPk()
- This method loads Client PublicKey from the file system
putClientPublicKey
public static boolean putClientPublicKey(PrintWriter out,
String clientID,
byte tmp[])
- This method when given a public key for a client as a byte array
puts it into the Server Database as a Binary Large Object( blob)
getLogin
public String getLogin()
getDecryptedObject
public Object getDecryptedObject(HttpServletRequest req) throws Exception
- This Method decrypts the request stream using the server's secret key,
deserializes it and returns an object associated with it
getCryptedStream
public byte[] getCryptedStream(Object ob) throws Exception
- Takes an object, serializes it and returns a byte array crypted by
the client's public key.
main
public static void main(String args[])
- On command line invocation creates server public key and server
private key.Server Public key should be accessible to application
developers from the servers site.And private key should be stored
securely.