org.ldaptive.ssl
Class X509SSLContextInitializer

java.lang.Object
  extended by org.ldaptive.ssl.AbstractSSLContextInitializer
      extended by org.ldaptive.ssl.X509SSLContextInitializer
All Implemented Interfaces:
SSLContextInitializer

public class X509SSLContextInitializer
extends AbstractSSLContextInitializer

Provides an SSL context initializer which can use X.509 certificates to create key and trust managers.

Version:
$Revision: 3242 $ $Date: 2017-09-11 17:26:30 -0400 (Mon, 11 Sep 2017) $
Author:
Middleware Services

Field Summary
 
Fields inherited from class org.ldaptive.ssl.AbstractSSLContextInitializer
hostnameVerifierConfig, logger, trustManagers
 
Constructor Summary
X509SSLContextInitializer()
           
 
Method Summary
protected  TrustManager[] createTrustManagers()
          Creates any trust managers specific to this context initializer.
 X509Certificate getAuthenticationCertificate()
          Returns the certificate to use for creating the key managers.
 PrivateKey getAuthenticationKey()
          Returns the private key associated with the authentication certificate.
 KeyManager[] getKeyManagers()
          Returns the key managers used when creating SSL contexts.
 X509Certificate[] getTrustCertificates()
          Returns the certificates to use for creating the trust managers.
 void setAuthenticationCertificate(X509Certificate cert)
          Sets the certificate to use for creating the key managers.
 void setAuthenticationKey(PrivateKey key)
          Sets the private key associated with the authentication certificate.
 void setTrustCertificates(X509Certificate... certs)
          Sets the certificates to use for creating the trust managers.
 String toString()
           
 
Methods inherited from class org.ldaptive.ssl.AbstractSSLContextInitializer
aggregateTrustManagers, getHostnameVerifierConfig, getTrustManagers, initSSLContext, setHostnameVerifierConfig, setTrustManagers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

X509SSLContextInitializer

public X509SSLContextInitializer()
Method Detail

getTrustCertificates

public X509Certificate[] getTrustCertificates()
Returns the certificates to use for creating the trust managers.

Returns:
X.509 certificates

setTrustCertificates

public void setTrustCertificates(X509Certificate... certs)
Sets the certificates to use for creating the trust managers.

Parameters:
certs - X.509 certificates

getAuthenticationCertificate

public X509Certificate getAuthenticationCertificate()
Returns the certificate to use for creating the key managers.

Returns:
X.509 certificate

setAuthenticationCertificate

public void setAuthenticationCertificate(X509Certificate cert)
Sets the certificate to use for creating the key managers.

Parameters:
cert - X.509 certificate

getAuthenticationKey

public PrivateKey getAuthenticationKey()
Returns the private key associated with the authentication certificate.

Returns:
private key

setAuthenticationKey

public void setAuthenticationKey(PrivateKey key)
Sets the private key associated with the authentication certificate.

Parameters:
key - private key

createTrustManagers

protected TrustManager[] createTrustManagers()
                                      throws GeneralSecurityException
Creates any trust managers specific to this context initializer.

Specified by:
createTrustManagers in class AbstractSSLContextInitializer
Returns:
trust managers
Throws:
GeneralSecurityException - if an errors occurs while loading the TrustManagers

getKeyManagers

public KeyManager[] getKeyManagers()
                            throws GeneralSecurityException
Returns the key managers used when creating SSL contexts.

Returns:
key managers
Throws:
GeneralSecurityException - if an errors occurs while loading the KeyManagers

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2003-2017 Virginia Tech. All Rights Reserved.