Package org.ldaptive.ssl
Class KeyStoreCredentialConfig
- java.lang.Object
-
- org.ldaptive.AbstractFreezable
-
- org.ldaptive.ssl.KeyStoreCredentialConfig
-
- All Implemented Interfaces:
Freezable,CredentialConfig
public class KeyStoreCredentialConfig extends AbstractFreezable implements CredentialConfig
Provides the properties necessary for creating an SSL context initializer with a keystore credential reader.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classKeyStoreCredentialConfig.Builder
-
Field Summary
Fields Modifier and Type Field Description private static intHASH_CODE_SEEDhash code seed.private StringkeyStoreName of the keystore to use for the SSL connection.private String[]keyStoreAliasesKeystore aliases to use.private StringkeyStorePasswordPassword needed to open the keystore.private KeyStoreCredentialReaderkeyStoreReaderHandles loading keystores.private StringkeyStoreTypeKeystore type.private StringtrustStoreName of the truststore to use for the SSL connection.private String[]trustStoreAliasesTruststore aliases to use.private StringtrustStorePasswordPassword needed to open the truststore.private StringtrustStoreTypeTruststore type.
-
Constructor Summary
Constructors Constructor Description KeyStoreCredentialConfig()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static KeyStoreCredentialConfig.Builderbuilder()Creates a builder for this class.SSLContextInitializercreateSSLContextInitializer()Creates an SSL context initializer using the configured trust and authentication material in this config.booleanequals(Object o)StringgetKeyStore()Returns the name of the keystore to use.String[]getKeyStoreAliases()Returns the aliases of the keystore to use.StringgetKeyStorePassword()Returns the password for the keystore.StringgetKeyStoreType()Returns the type of the keystore.StringgetTrustStore()Returns the name of the truststore to use.String[]getTrustStoreAliases()Returns the aliases of the truststore to use.StringgetTrustStorePassword()Returns the password for the truststore.StringgetTrustStoreType()Returns the type of the truststore.inthashCode()voidsetKeyStore(String name)Sets the name of the keystore to use.voidsetKeyStoreAliases(String... aliases)Sets the aliases of the keystore to use.voidsetKeyStorePassword(String password)Sets the password for the keystore.voidsetKeyStoreType(String type)Sets the type of the keystore.voidsetTrustStore(String name)Sets the name of the truststore to use.voidsetTrustStoreAliases(String... aliases)Sets the aliases of the truststore to use.voidsetTrustStorePassword(String password)Sets the password for the truststore.voidsetTrustStoreType(String type)Sets the type of the truststore.StringtoString()-
Methods inherited from class org.ldaptive.AbstractFreezable
assertMutable, freeze, freeze, freeze, isFrozen
-
-
-
-
Field Detail
-
HASH_CODE_SEED
private static final int HASH_CODE_SEED
hash code seed.- See Also:
- Constant Field Values
-
keyStoreReader
private final KeyStoreCredentialReader keyStoreReader
Handles loading keystores.
-
trustStore
private String trustStore
Name of the truststore to use for the SSL connection.
-
trustStorePassword
private String trustStorePassword
Password needed to open the truststore.
-
trustStoreType
private String trustStoreType
Truststore type.
-
trustStoreAliases
private String[] trustStoreAliases
Truststore aliases to use.
-
keyStore
private String keyStore
Name of the keystore to use for the SSL connection.
-
keyStorePassword
private String keyStorePassword
Password needed to open the keystore.
-
keyStoreType
private String keyStoreType
Keystore type.
-
keyStoreAliases
private String[] keyStoreAliases
Keystore aliases to use.
-
-
Method Detail
-
getTrustStore
public String getTrustStore()
Returns the name of the truststore to use.- Returns:
- truststore name
-
setTrustStore
public void setTrustStore(String name)
Sets the name of the truststore to use.- Parameters:
name- truststore name
-
getTrustStorePassword
public String getTrustStorePassword()
Returns the password for the truststore.- Returns:
- truststore password
-
setTrustStorePassword
public void setTrustStorePassword(String password)
Sets the password for the truststore.- Parameters:
password- truststore password
-
getTrustStoreType
public String getTrustStoreType()
Returns the type of the truststore.- Returns:
- truststore type
-
setTrustStoreType
public void setTrustStoreType(String type)
Sets the type of the truststore.- Parameters:
type- truststore type
-
getTrustStoreAliases
public String[] getTrustStoreAliases()
Returns the aliases of the truststore to use.- Returns:
- truststore aliases
-
setTrustStoreAliases
public void setTrustStoreAliases(String... aliases)
Sets the aliases of the truststore to use.- Parameters:
aliases- truststore aliases
-
getKeyStore
public String getKeyStore()
Returns the name of the keystore to use.- Returns:
- keystore name
-
setKeyStore
public void setKeyStore(String name)
Sets the name of the keystore to use.- Parameters:
name- keystore name
-
getKeyStorePassword
public String getKeyStorePassword()
Returns the password for the keystore.- Returns:
- keystore password
-
setKeyStorePassword
public void setKeyStorePassword(String password)
Sets the password for the keystore.- Parameters:
password- keystore password
-
getKeyStoreType
public String getKeyStoreType()
Returns the type of the keystore.- Returns:
- keystore type
-
setKeyStoreType
public void setKeyStoreType(String type)
Sets the type of the keystore.- Parameters:
type- keystore type
-
getKeyStoreAliases
public String[] getKeyStoreAliases()
Returns the aliases of the keystore to use.- Returns:
- keystore aliases
-
setKeyStoreAliases
public void setKeyStoreAliases(String... aliases)
Sets the aliases of the keystore to use.- Parameters:
aliases- keystore aliases
-
createSSLContextInitializer
public SSLContextInitializer createSSLContextInitializer() throws GeneralSecurityException
Description copied from interface:CredentialConfigCreates an SSL context initializer using the configured trust and authentication material in this config.- Specified by:
createSSLContextInitializerin interfaceCredentialConfig- Returns:
- SSL context initializer
- Throws:
GeneralSecurityException- if the ssl context initializer cannot be created
-
builder
public static KeyStoreCredentialConfig.Builder builder()
Creates a builder for this class.- Returns:
- new builder
-
-