All Packages Class Hierarchy This Package Previous Next Index
Class CAS.CAS.CryptServer
java.lang.Object
|
+----CAS.CAS.CryptServer
- public class CryptServer
- 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
At the same time, we sign the message with the private key of the Server
which the client verifies with the public key of the server
-
cipherName
-
-
clientID
-
-
clientPk
-
-
conn
-
-
keyPairName
-
-
rsa
-
-
serverSk
-
-
sigalgo
-
-
strength
-
-
CryptServer(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[])
- This Method converts byte array into an InputStream
-
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)
keyPairName
protected static final String keyPairName
cipherName
protected static final String cipherName
sigalgo
protected static final String sigalgo
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
CryptServer
public CryptServer(String serverSkFile)
- Loads the server secret key.
getObjectInputStream
protected static ObjectInputStream getObjectInputStream(byte inbuf[]) throws IOException
- This Method converts byte array into an InputStream
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.
All Packages Class Hierarchy This Package Previous Next Index