ClientSession
 
- home
- download
- quick start
- options
- performance
SourceForge.net Logo
Options

No security

SessionManager sessionManager = new FullSessionManager();

Signed messages - so that clients can't fake a session

KeyPair pair = //get key pair;
SessionManager sessionManager = new FullSessionManager();
sessionManager.enableSigning(keyPair, "SHA1withDSA");

Encrypted messages - so that clients can't see what's in a session

SecretKey key = //get secret key;
SessionManager sessionManager = new FullSessionManager();
sessionManager.enableEncrypting(key, "DES");

Security tips

Signing and encrypting can be combined for full security. The algorithm passed into these methods must be compatible with the key type or a CryptoException will be thrown.

Codecs

When binary data is back and forth to a String a Codec is used. The default implementation uses a hexadecimal encoding. A different encoding can be used by calling the setCodec() method with an implementation of the Codec interface.