public class KeyStoreSSLContextInitializer extends AbstractSSLContextInitializer
Modifier and Type | Field and Description |
---|---|
private String[] |
authenticationAliases
Aliases of key entries to use.
|
private KeyStore |
authenticationKeystore
KeyStore used to create key managers.
|
private char[] |
authenticationPassword
Password used to access the authentication keystore.
|
private String[] |
trustAliases
Aliases of trust entries to use.
|
private KeyStore |
trustKeystore
KeyStore used to create trust managers.
|
hostnameVerifierConfig, logger, trustManagers
Constructor and Description |
---|
KeyStoreSSLContextInitializer() |
Modifier and Type | Method and Description |
---|---|
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.
|
protected KeyManagerFactory |
getKeyManagerFactory(KeyStore keystore,
char[] password,
String... aliases)
Creates a new key manager factory.
|
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.
|
protected TrustManagerFactory |
getTrustManagerFactory(KeyStore keystore,
String... aliases)
Creates a new trust manager factory.
|
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() |
aggregateTrustManagers, getHostnameVerifierConfig, getTrustManagers, initSSLContext, setHostnameVerifierConfig, setTrustManagers
private KeyStore trustKeystore
private String[] trustAliases
private KeyStore authenticationKeystore
private String[] authenticationAliases
private char[] authenticationPassword
public KeyStore getTrustKeystore()
public void setTrustKeystore(KeyStore keystore)
keystore
- to setpublic String[] getTrustAliases()
public void setTrustAliases(String... aliases)
aliases
- to usepublic KeyStore getAuthenticationKeystore()
public void setAuthenticationKeystore(KeyStore keystore)
keystore
- to setpublic String[] getAuthenticationAliases()
public void setAuthenticationAliases(String... aliases)
aliases
- to usepublic char[] getAuthenticationPassword()
public void setAuthenticationPassword(char[] password)
password
- to use for authenticationprotected TrustManager[] createTrustManagers() throws GeneralSecurityException
AbstractSSLContextInitializer
createTrustManagers
in class AbstractSSLContextInitializer
GeneralSecurityException
- if an errors occurs while loading the TrustManagersprotected TrustManagerFactory getTrustManagerFactory(KeyStore keystore, String... aliases) throws GeneralSecurityException
keystore
- to initialize the trust manager factoryaliases
- to include from the supplied keystore or null to include all entriesGeneralSecurityException
- if the trust manager factory cannot be initializedpublic KeyManager[] getKeyManagers() throws GeneralSecurityException
SSLContextInitializer
GeneralSecurityException
- if an errors occurs while loading the KeyManagersprotected KeyManagerFactory getKeyManagerFactory(KeyStore keystore, char[] password, String... aliases) throws GeneralSecurityException
keystore
- to initialize the key manager factorypassword
- to unlock the supplied keystorealiases
- to include from the supplied keystore or null to include all entriesGeneralSecurityException
- if the key manager factory cannot be initializedCopyright © 2003-2019 Virginia Tech. All Rights Reserved.