Package org.ldaptive.ssl
Class CredentialConfigFactory
- java.lang.Object
-
- org.ldaptive.ssl.CredentialConfigFactory
-
public final class CredentialConfigFactory extends Object
Utility class for creating credential configs when the underlying credential is already available for use.
-
-
Constructor Summary
Constructors Modifier Constructor Description privateCredentialConfigFactory()Default constructor.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CredentialConfigcreateKeyStoreCredentialConfig(KeyStore trustStore)Creates a KeyStoreCredentialConfig from the supplied truststore.static CredentialConfigcreateKeyStoreCredentialConfig(KeyStore keyStore, String keyStorePassword)Creates a KeyStoreCredentialConfig from the supplied keystore and password.static CredentialConfigcreateKeyStoreCredentialConfig(KeyStore trustStore, String[] trustStoreAliases)Creates a KeyStoreCredentialConfig from the supplied truststore.static CredentialConfigcreateKeyStoreCredentialConfig(KeyStore trustStore, String[] trustStoreAliases, KeyStore keyStore, String keyStorePassword, String[] keyStoreAliases)Creates a KeyStoreCredentialConfig from the supplied truststore, keystore and password.static CredentialConfigcreateKeyStoreCredentialConfig(KeyStore keyStore, String keyStorePassword, String[] keyStoreAliases)Creates a KeyStoreCredentialConfig from the supplied keystore and password.static CredentialConfigcreateKeyStoreCredentialConfig(KeyStore trustStore, KeyStore keyStore, String keyStorePassword)Creates a KeyStoreCredentialConfig from the supplied truststore, keystore and password.static CredentialConfigcreateX509CredentialConfig(String trustCertificates)Creates a X509CredentialConfig from PEM encoded certificate(s).static CredentialConfigcreateX509CredentialConfig(X509Certificate[] trustCertificates)Creates a X509CredentialConfig from the supplied trust certificates.static CredentialConfigcreateX509CredentialConfig(X509Certificate[] trustCertificates, X509Certificate authenticationCertificate, PrivateKey authenticationKey)Creates a X509CredentialConfig from the supplied trust certificates, authentication certificate and private key.static CredentialConfigcreateX509CredentialConfig(X509Certificate authenticationCertificate, PrivateKey authenticationKey)Creates a X509CredentialConfig from the supplied authentication certificate and private key.
-
-
-
Method Detail
-
createKeyStoreCredentialConfig
public static CredentialConfig createKeyStoreCredentialConfig(KeyStore trustStore)
Creates a KeyStoreCredentialConfig from the supplied truststore.- Parameters:
trustStore- to create credential config from- Returns:
- credential config
-
createKeyStoreCredentialConfig
public static CredentialConfig createKeyStoreCredentialConfig(KeyStore trustStore, String[] trustStoreAliases)
Creates a KeyStoreCredentialConfig from the supplied truststore.- Parameters:
trustStore- to create credential config fromtrustStoreAliases- to use in the truststore- Returns:
- credential config
-
createKeyStoreCredentialConfig
public static CredentialConfig createKeyStoreCredentialConfig(KeyStore keyStore, String keyStorePassword)
Creates a KeyStoreCredentialConfig from the supplied keystore and password.- Parameters:
keyStore- to create credential config fromkeyStorePassword- to unlock the keystore- Returns:
- credential config
-
createKeyStoreCredentialConfig
public static CredentialConfig createKeyStoreCredentialConfig(KeyStore keyStore, String keyStorePassword, String[] keyStoreAliases)
Creates a KeyStoreCredentialConfig from the supplied keystore and password.- Parameters:
keyStore- to create credential config fromkeyStorePassword- to unlock the keystorekeyStoreAliases- to use in the keystore- Returns:
- credential config
-
createKeyStoreCredentialConfig
public static CredentialConfig createKeyStoreCredentialConfig(KeyStore trustStore, KeyStore keyStore, String keyStorePassword)
Creates a KeyStoreCredentialConfig from the supplied truststore, keystore and password.- Parameters:
trustStore- to create credential config fromkeyStore- to create credential config fromkeyStorePassword- to unlock the keystore- Returns:
- credential config
-
createKeyStoreCredentialConfig
public static CredentialConfig createKeyStoreCredentialConfig(KeyStore trustStore, String[] trustStoreAliases, KeyStore keyStore, String keyStorePassword, String[] keyStoreAliases)
Creates a KeyStoreCredentialConfig from the supplied truststore, keystore and password.- Parameters:
trustStore- to create credential config fromtrustStoreAliases- to use in the truststorekeyStore- to create credential config fromkeyStorePassword- to unlock the keystorekeyStoreAliases- to use in the keystore- Returns:
- credential config
-
createX509CredentialConfig
public static CredentialConfig createX509CredentialConfig(X509Certificate[] trustCertificates)
Creates a X509CredentialConfig from the supplied trust certificates.- Parameters:
trustCertificates- to create credential config from- Returns:
- credential config
-
createX509CredentialConfig
public static CredentialConfig createX509CredentialConfig(X509Certificate authenticationCertificate, PrivateKey authenticationKey)
Creates a X509CredentialConfig from the supplied authentication certificate and private key.- Parameters:
authenticationCertificate- to create credential config fromauthenticationKey- that belongs to the certificate- Returns:
- credential config
-
createX509CredentialConfig
public static CredentialConfig createX509CredentialConfig(X509Certificate[] trustCertificates, X509Certificate authenticationCertificate, PrivateKey authenticationKey)
Creates a X509CredentialConfig from the supplied trust certificates, authentication certificate and private key.- Parameters:
trustCertificates- to create credential config fromauthenticationCertificate- to create credential config fromauthenticationKey- that belongs to the certificate- Returns:
- credential config
-
createX509CredentialConfig
public static CredentialConfig createX509CredentialConfig(String trustCertificates)
Creates a X509CredentialConfig from PEM encoded certificate(s).- Parameters:
trustCertificates- to create credential config from- Returns:
- credential config
-
-