All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class iaik.security.ssl.SSLContext

java.lang.Object
   |
   +----iaik.security.ssl.SSLContext

public class SSLContext
extends Object
This class is used to manage all properties of a SSLSocket.

See Also:
CipherSuite, CompressionMethod, SessionManager, DefaultSessionManager, TrustDecider, DefaultTrustDecider

Constructor Index

 o SSLContext()
Create a default SSLContext.

Method Index

 o getCertificateChain()
Returns the certificate chain set through setCertificate().
 o getEnabledCipherSuites()
Returns the cipher suites which are enabled in this SSLContext.
 o getEnabledCompressionMethods()
Returns the compression methods which are enabled in this SSLContext.
 o getPrivateKey()
Returns the private key set through setCertificate().
 o getRandomGenerator()
Returns the random number generator currently used by this SSLContext.
 o getRequirePeerCertificate()
Returns wheter a SSLSocket which uses this SSLContext requires a certificate from the peer.
 o getSessionManager()
Returns the session manager defined by this SSLContext.
 o getTempKeyPair()
Returns the temporary key pair.
 o getTrustDecider()
Returns the TrustDecider of this SSLContext.
 o setCertificate(X509Certificate[], PrivateKey)
Set the certificate chain and the corresponding private key for a SSLSocket.
 o setEnabledCipherSuites(CipherSuite[])
Sets the cipher suites which are enabled in this SSLContext.
 o setEnabledCompressionMethods(CompressionMethod[])
Sets the compression methods which are enabled in this SSLContext.
 o setRandomGenerator(SecureRandom)
Sets the random number generator of this SSLContext.
 o setRequirePeerCertificate(boolean)
This method is used to switch on client authentication
 o setSessionManager(SessionManager)
Sets the session manager defined by this SSLContext.
 o setTempKeyPair(KeyPair)
Sets the temporary key pair.
 o setTrustDecider(TrustDecider)
Sets the TrustDecider of this SSLContext.
 o toString()
Returns a string representation of this SSLContext.

Constructors

 o SSLContext
 public SSLContext()
Create a default SSLContext.

Methods

 o setCertificate
 public void setCertificate(X509Certificate certificateChain[],
                            PrivateKey privateKey)
Set the certificate chain and the corresponding private key for a SSLSocket. It is also possible to set only one parameter. Just set the other to null.

Parameters:
certificateChain - a sequence of X.509v3 certificates
privateKey - the private key for the sender's certificate
 o getCertificateChain
 public X509Certificate[] getCertificateChain()
Returns the certificate chain set through setCertificate().

Returns:
the certificate chain set through setCertificate()
 o getPrivateKey
 public PrivateKey getPrivateKey()
Returns the private key set through setCertificate().

Returns:
the private key set through setCertificate()
 o getTempKeyPair
 public KeyPair getTempKeyPair()
Returns the temporary key pair.

Returns:
the temporary key pair
 o setTempKeyPair
 public void setTempKeyPair(KeyPair tempKeyPair)
Sets the temporary key pair.

Parameters:
tempKeyPair - the temporary key pair
 o getRandomGenerator
 public SecureRandom getRandomGenerator()
Returns the random number generator currently used by this SSLContext.

Returns:
the random number generator currently used by this SSLContext
 o setRandomGenerator
 public void setRandomGenerator(SecureRandom randomGenerator)
Sets the random number generator of this SSLContext.

Parameters:
randomGenerator - the random number generator to use
 o getSessionManager
 public SessionManager getSessionManager()
Returns the session manager defined by this SSLContext.

Returns:
the session manager defined by this SSLContext
 o setSessionManager
 public void setSessionManager(SessionManager sessionManager)
Sets the session manager defined by this SSLContext.

Parameters:
sessionManager - the session manager defined by this SSLContext
 o getEnabledCipherSuites
 public CipherSuite[] getEnabledCipherSuites()
Returns the cipher suites which are enabled in this SSLContext.

Returns:
the cipher suites which are enabled in this SSLContext
 o setEnabledCipherSuites
 public void setEnabledCipherSuites(CipherSuite enabledCipherSuites[])
Sets the cipher suites which are enabled in this SSLContext.

Parameters:
enabledCipherSuites - the cipher suites which are enabled in this SSLContext
 o getEnabledCompressionMethods
 public CompressionMethod[] getEnabledCompressionMethods()
Returns the compression methods which are enabled in this SSLContext.

Returns:
the compression methods which are enabled in this SSLContext
 o setEnabledCompressionMethods
 public void setEnabledCompressionMethods(CompressionMethod enabledCompressionMethods[])
Sets the compression methods which are enabled in this SSLContext.

Parameters:
enabledCompressionMethods - the compression methods which are enabled in this SSLContext
 o getTrustDecider
 public TrustDecider getTrustDecider()
Returns the TrustDecider of this SSLContext.

Returns:
the TrustDecider of this SSLContext
 o setTrustDecider
 public void setTrustDecider(TrustDecider trustDecider)
Sets the TrustDecider of this SSLContext.

Parameters:
trustDecider - the TrustDecider of this SSLContext
 o getRequirePeerCertificate
 public boolean getRequirePeerCertificate()
Returns wheter a SSLSocket which uses this SSLContext requires a certificate from the peer.

Returns:
true, if a peer certificate is required
 o setRequirePeerCertificate
 public void setRequirePeerCertificate(boolean require)
This method is used to switch on client authentication

Parameters:
require - true, if a peer certificate is required
 o toString
 public String toString()
Returns a string representation of this SSLContext.

Returns:
a string representation
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index