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


Variable Index

 o cipherName
 o clientID
 o clientPk
 o conn
 o keyPairName
 o rsa
 o serverSk
 o sigalgo
 o strength

Constructor Index

 o CryptServer(String)
Loads the server secret key.

Method Index

 o getCryptedStream(Object)
Takes an object, serializes it and returns a byte array crypted by the client's public key.
 o getDecryptedObject(HttpServletRequest)
This Method decrypts the request stream using the server's secret key, deserializes it and returns an object associated with it.
 o getLogin()
 o getObjectInputStream(byte[])
This Method converts byte array into an InputStream
 o loadClientDBPk()
This method loads Client Public Key from Database
 o loadClientPk()
This method loads Client PublicKey from the file system
 o 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.
 o 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)

Variables

 o keyPairName
 protected static final String keyPairName
 o cipherName
 protected static final String cipherName
 o sigalgo
 protected static final String sigalgo
 o strength
 protected static final int strength
 o conn
 protected static Connection conn
 o clientID
 public String clientID
 o rsa
 protected Cipher rsa
 o clientPk
 protected PublicKey clientPk
 o serverSk
 protected PrivateKey serverSk

Constructors

 o CryptServer
 public CryptServer(String serverSkFile)
Loads the server secret key.

Methods

 o getObjectInputStream
 protected static ObjectInputStream getObjectInputStream(byte inbuf[]) throws IOException
This Method converts byte array into an InputStream

 o loadClientDBPk
 public boolean loadClientDBPk()
This method loads Client Public Key from Database

 o loadClientPk
 public boolean loadClientPk()
This method loads Client PublicKey from the file system

 o 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)

 o getLogin
 public String getLogin()
 o 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.

 o 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.

 o 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