com.kodemuse.security.ssl
Class SSLContext
java.lang.Object
|
+--com.kodemuse.security.ssl.LogCapability
|
+--com.kodemuse.security.ssl.SSLContext
- public class SSLContext
- extends LogCapability
Context for SSL communciation. Encapsulates Identity information.
There may be a one SSLContext for all the server side connections.
- Author:
- Harmeet Bedi
Constructor Summary |
SSLContext()
No Paramaters. |
SSLContext(java.io.File keyStorePKCS12File,
java.lang.String password)
|
SSLContext(java.security.KeyStore keyStore,
java.lang.String password)
|
SSLContext(java.security.cert.X509Certificate[] certChain,
java.security.interfaces.RSAPrivateKey privateKey)
|
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SSLContext
public SSLContext()
- No Paramaters. May be used by anonymous SSL Client.
SSLContext
public SSLContext(java.io.File keyStorePKCS12File,
java.lang.String password)
throws java.lang.Exception
- Parameters:
keyStorePKCS12File:
- PKCS12 indentity filepassword:
- password for the PKCS12 identity. PKCS12 is a PBE standard.
SSLContext
public SSLContext(java.security.KeyStore keyStore,
java.lang.String password)
throws java.lang.Exception
- Parameters:
keyStore:
- KeyStore. Identity for SSL communication.password:
- password for the key store.
SSLContext
public SSLContext(java.security.cert.X509Certificate[] certChain,
java.security.interfaces.RSAPrivateKey privateKey)
throws java.lang.Exception
- Parameters:
certChain:
- Certificate chain.privateKey:
- private key for the identity.
getSupportedCipherSpec
CipherSpec[] getSupportedCipherSpec()
selectCipherSpec
CipherSpec selectCipherSpec(CipherSpec[] cs)
getHandshakeCertificateChain
CertificateChain getHandshakeCertificateChain()
getPrivateKey
java.security.interfaces.RSAPrivateKey getPrivateKey()
getSSLServerSocketDecorator
public ConnectionDecorator getSSLServerSocketDecorator(TrustStore store)
- Converts Socket to Server Side SSL Socket
- Parameters:
trustedCerts:
- if null, the server side trusts
unauthenticated client connections. if not null the server
request client certificates. The client certificate is
validated against truststore
getSSLClientSocketDecorator
public ConnectionDecorator getSSLClientSocketDecorator(TrustStore store)
getServerSessionEntry
ResumedSessionEntry getServerSessionEntry(java.lang.String ipAddr,
int port)
- Called by client side to get server session entry information,
- Parameters:
ipAddr
- Server IP address
cacheServerSession
void cacheServerSession(java.lang.String ipAddr,
int port,
SessionID sessionID,
byte[] masterSecret,
CipherSpec spec)
getClientSessionEntry
ResumedSessionEntry getClientSessionEntry(SessionID sessionID)
cacheClientSession
void cacheClientSession(SessionID sessionID,
byte[] masterSecret,
CipherSpec spec)