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 class
KeyStoreCredentialConfig.Builder
-
Field Summary
Fields Modifier and Type Field Description private static int
HASH_CODE_SEED
hash code seed.private String
keyStore
Name of the keystore to use for the SSL connection.private String[]
keyStoreAliases
Keystore aliases to use.private String
keyStorePassword
Password needed to open the keystore.private KeyStoreCredentialReader
keyStoreReader
Handles loading keystores.private String
keyStoreType
Keystore type.private String
trustStore
Name of the truststore to use for the SSL connection.private String[]
trustStoreAliases
Truststore aliases to use.private String
trustStorePassword
Password needed to open the truststore.private String
trustStoreType
Truststore type.
-
Constructor Summary
Constructors Constructor Description KeyStoreCredentialConfig()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static KeyStoreCredentialConfig.Builder
builder()
Creates a builder for this class.SSLContextInitializer
createSSLContextInitializer()
Creates an SSL context initializer using the configured trust and authentication material in this config.boolean
equals(Object o)
String
getKeyStore()
Returns the name of the keystore to use.String[]
getKeyStoreAliases()
Returns the aliases of the keystore to use.String
getKeyStorePassword()
Returns the password for the keystore.String
getKeyStoreType()
Returns the type of the keystore.String
getTrustStore()
Returns the name of the truststore to use.String[]
getTrustStoreAliases()
Returns the aliases of the truststore to use.String
getTrustStorePassword()
Returns the password for the truststore.String
getTrustStoreType()
Returns the type of the truststore.int
hashCode()
void
setKeyStore(String name)
Sets the name of the keystore to use.void
setKeyStoreAliases(String... aliases)
Sets the aliases of the keystore to use.void
setKeyStorePassword(String password)
Sets the password for the keystore.void
setKeyStoreType(String type)
Sets the type of the keystore.void
setTrustStore(String name)
Sets the name of the truststore to use.void
setTrustStoreAliases(String... aliases)
Sets the aliases of the truststore to use.void
setTrustStorePassword(String password)
Sets the password for the truststore.void
setTrustStoreType(String type)
Sets the type of the truststore.String
toString()
-
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:CredentialConfig
Creates an SSL context initializer using the configured trust and authentication material in this config.- Specified by:
createSSLContextInitializer
in 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
-
-