org.ldaptive.ssl
Class KeyStoreSSLContextInitializer

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

public class KeyStoreSSLContextInitializer
extends AbstractSSLContextInitializer

Provides an SSL context initializer which can use java KeyStores to create key and trust managers.

Version:
$Revision: 3245 $ $Date: 2017-09-19 23:08:23 -0400 (Tue, 19 Sep 2017) $
Author:
Middleware Services

Field Summary
 
Fields inherited from class org.ldaptive.ssl.AbstractSSLContextInitializer
hostnameVerifierConfig, logger, trustManagers
 
Constructor Summary
KeyStoreSSLContextInitializer()
           
 
Method Summary
protected  TrustManager[] createTrustManagers()
          Creates any trust managers specific to this context initializer.
 String[] getAuthenticationAliases()
          Returns the aliases of the entries to use in the authentication keystore.
 KeyStore getAuthenticationKeystore()
          Returns the keystore to use for creating the key managers.
 char[] getAuthenticationPassword()
          Returns the password used for accessing the authentication keystore.
 KeyManager[] getKeyManagers()
          Returns the key managers used when creating SSL contexts.
 String[] getTrustAliases()
          Returns the aliases of the entries to use in the trust keystore.
 KeyStore getTrustKeystore()
          Returns the keystore to use for creating the trust managers.
 void setAuthenticationAliases(String... aliases)
          Sets the aliases of the entries to use in the authentication keystore.
 void setAuthenticationKeystore(KeyStore keystore)
          Sets the keystore to use for creating the key managers.
 void setAuthenticationPassword(char[] password)
          Sets the password used for accessing the authentication keystore.
 void setTrustAliases(String... aliases)
          Sets the aliases of the entries to use in the trust keystore.
 void setTrustKeystore(KeyStore keystore)
          Sets the keystore 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

KeyStoreSSLContextInitializer

public KeyStoreSSLContextInitializer()
Method Detail

getTrustKeystore

public KeyStore getTrustKeystore()
Returns the keystore to use for creating the trust managers.

Returns:
keystore

setTrustKeystore

public void setTrustKeystore(KeyStore keystore)
Sets the keystore to use for creating the trust managers.

Parameters:
keystore - to set

getTrustAliases

public String[] getTrustAliases()
Returns the aliases of the entries to use in the trust keystore.

Returns:
trust aliases

setTrustAliases

public void setTrustAliases(String... aliases)
Sets the aliases of the entries to use in the trust keystore.

Parameters:
aliases - to use

getAuthenticationKeystore

public KeyStore getAuthenticationKeystore()
Returns the keystore to use for creating the key managers.

Returns:
keystore

setAuthenticationKeystore

public void setAuthenticationKeystore(KeyStore keystore)
Sets the keystore to use for creating the key managers.

Parameters:
keystore - to set

getAuthenticationAliases

public String[] getAuthenticationAliases()
Returns the aliases of the entries to use in the authentication keystore.

Returns:
authentication aliases

setAuthenticationAliases

public void setAuthenticationAliases(String... aliases)
Sets the aliases of the entries to use in the authentication keystore.

Parameters:
aliases - to use

getAuthenticationPassword

public char[] getAuthenticationPassword()
Returns the password used for accessing the authentication keystore.

Returns:
authentication password

setAuthenticationPassword

public void setAuthenticationPassword(char[] password)
Sets the password used for accessing the authentication keystore.

Parameters:
password - to use for authentication

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.