Package org.ldaptive.ssl
Class CredentialConfigFactory
java.lang.Object
org.ldaptive.ssl.CredentialConfigFactory
Utility class for creating credential configs when the underlying credential is already available for use.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.
-
Constructor Details
-
CredentialConfigFactory
private CredentialConfigFactory()Default constructor.
-
-
Method Details
-
createKeyStoreCredentialConfig
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
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
Creates a X509CredentialConfig from PEM encoded certificate(s).- Parameters:
trustCertificates- to create credential config from- Returns:
- credential config
-