Package org.ldaptive.ssl
Class X509CredentialConfig
- java.lang.Object
-
- org.ldaptive.AbstractFreezable
-
- org.ldaptive.ssl.X509CredentialConfig
-
- All Implemented Interfaces:
Freezable,CredentialConfig
public class X509CredentialConfig extends AbstractFreezable implements CredentialConfig
Provides the properties necessary for creating an SSL context initializer with an X.509 credential reader.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classX509CredentialConfig.Builder
-
Field Summary
Fields Modifier and Type Field Description private StringauthenticationCertificateName of the authentication certificate to use for the SSL connection.private StringauthenticationKeyName of the key to use for the SSL connection.private X509CertificateCredentialReadercertReaderReads X.509 certificate credential.private X509CertificatesCredentialReadercertsReaderReads X.509 certificates credential.private static intHASH_CODE_SEEDhash code seed.private PrivateKeyCredentialReaderkeyReaderReads private key credential.private StringtrustCertificatesName of the trust certificates to use for the SSL connection.
-
Constructor Summary
Constructors Constructor Description X509CredentialConfig()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static X509CredentialConfig.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)StringgetAuthenticationCertificate()Returns the name of the authentication certificate to use.StringgetAuthenticationKey()Returns the name of the authentication key to use.StringgetTrustCertificates()Returns the name of the trust certificates to use.inthashCode()voidsetAuthenticationCertificate(String name)Sets the name of the authentication certificate to use.voidsetAuthenticationKey(String name)Sets the name of the authentication key to use.voidsetTrustCertificates(String name)Sets the name of the trust certificates to use.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
-
certsReader
private final X509CertificatesCredentialReader certsReader
Reads X.509 certificates credential.
-
certReader
private final X509CertificateCredentialReader certReader
Reads X.509 certificate credential.
-
keyReader
private final PrivateKeyCredentialReader keyReader
Reads private key credential.
-
trustCertificates
private String trustCertificates
Name of the trust certificates to use for the SSL connection.
-
authenticationCertificate
private String authenticationCertificate
Name of the authentication certificate to use for the SSL connection.
-
authenticationKey
private String authenticationKey
Name of the key to use for the SSL connection.
-
-
Method Detail
-
getTrustCertificates
public String getTrustCertificates()
Returns the name of the trust certificates to use.- Returns:
- trust certificates name
-
setTrustCertificates
public void setTrustCertificates(String name)
Sets the name of the trust certificates to use.- Parameters:
name- trust certificates name
-
getAuthenticationCertificate
public String getAuthenticationCertificate()
Returns the name of the authentication certificate to use.- Returns:
- authentication certificate name
-
setAuthenticationCertificate
public void setAuthenticationCertificate(String name)
Sets the name of the authentication certificate to use.- Parameters:
name- authentication certificate name
-
getAuthenticationKey
public String getAuthenticationKey()
Returns the name of the authentication key to use.- Returns:
- authentication key name
-
setAuthenticationKey
public void setAuthenticationKey(String name)
Sets the name of the authentication key to use.- Parameters:
name- authentication key name
-
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 X509CredentialConfig.Builder builder()
Creates a builder for this class.- Returns:
- new builder
-
-