Class CredentialConfigFactory


  • public final class CredentialConfigFactory
    extends java.lang.Object
    Utility class for creating credential configs when the underlying credential is already available for use.
    Author:
    Middleware Services
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static CredentialConfig createKeyStoreCredentialConfig​(java.security.KeyStore trustStore)
      Creates a KeyStoreCredentialConfig from the supplied truststore.
      static CredentialConfig createKeyStoreCredentialConfig​(java.security.KeyStore keyStore, java.lang.String keyStorePassword)
      Creates a KeyStoreCredentialConfig from the supplied keystore and password.
      static CredentialConfig createKeyStoreCredentialConfig​(java.security.KeyStore trustStore, java.lang.String[] trustStoreAliases)
      Creates a KeyStoreCredentialConfig from the supplied truststore.
      static CredentialConfig createKeyStoreCredentialConfig​(java.security.KeyStore trustStore, java.lang.String[] trustStoreAliases, java.security.KeyStore keyStore, java.lang.String keyStorePassword, java.lang.String[] keyStoreAliases)
      Creates a KeyStoreCredentialConfig from the supplied truststore, keystore and password.
      static CredentialConfig createKeyStoreCredentialConfig​(java.security.KeyStore keyStore, java.lang.String keyStorePassword, java.lang.String[] keyStoreAliases)
      Creates a KeyStoreCredentialConfig from the supplied keystore and password.
      static CredentialConfig createKeyStoreCredentialConfig​(java.security.KeyStore trustStore, java.security.KeyStore keyStore, java.lang.String keyStorePassword)
      Creates a KeyStoreCredentialConfig from the supplied truststore, keystore and password.
      static CredentialConfig createX509CredentialConfig​(java.lang.String trustCertificates)
      Creates a X509CredentialConfig from PEM encoded certificate(s).
      static CredentialConfig createX509CredentialConfig​(java.security.cert.X509Certificate[] trustCertificates)
      Creates a X509CredentialConfig from the supplied trust certificates.
      static CredentialConfig createX509CredentialConfig​(java.security.cert.X509Certificate[] trustCertificates, java.security.cert.X509Certificate authenticationCertificate, java.security.PrivateKey authenticationKey)
      Creates a X509CredentialConfig from the supplied trust certificates, authentication certificate and private key.
      static CredentialConfig createX509CredentialConfig​(java.security.cert.X509Certificate authenticationCertificate, java.security.PrivateKey authenticationKey)
      Creates a X509CredentialConfig from the supplied authentication certificate and private key.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • createKeyStoreCredentialConfig

        public static CredentialConfig createKeyStoreCredentialConfig​(java.security.KeyStore trustStore)
        Creates a KeyStoreCredentialConfig from the supplied truststore.
        Parameters:
        trustStore - to create credential config from
        Returns:
        credential config
      • createKeyStoreCredentialConfig

        public static CredentialConfig createKeyStoreCredentialConfig​(java.security.KeyStore trustStore,
                                                                      java.lang.String[] trustStoreAliases)
        Creates a KeyStoreCredentialConfig from the supplied truststore.
        Parameters:
        trustStore - to create credential config from
        trustStoreAliases - to use in the truststore
        Returns:
        credential config
      • createKeyStoreCredentialConfig

        public static CredentialConfig createKeyStoreCredentialConfig​(java.security.KeyStore keyStore,
                                                                      java.lang.String keyStorePassword)
        Creates a KeyStoreCredentialConfig from the supplied keystore and password.
        Parameters:
        keyStore - to create credential config from
        keyStorePassword - to unlock the keystore
        Returns:
        credential config
      • createKeyStoreCredentialConfig

        public static CredentialConfig createKeyStoreCredentialConfig​(java.security.KeyStore keyStore,
                                                                      java.lang.String keyStorePassword,
                                                                      java.lang.String[] keyStoreAliases)
        Creates a KeyStoreCredentialConfig from the supplied keystore and password.
        Parameters:
        keyStore - to create credential config from
        keyStorePassword - to unlock the keystore
        keyStoreAliases - to use in the keystore
        Returns:
        credential config
      • createKeyStoreCredentialConfig

        public static CredentialConfig createKeyStoreCredentialConfig​(java.security.KeyStore trustStore,
                                                                      java.security.KeyStore keyStore,
                                                                      java.lang.String keyStorePassword)
        Creates a KeyStoreCredentialConfig from the supplied truststore, keystore and password.
        Parameters:
        trustStore - to create credential config from
        keyStore - to create credential config from
        keyStorePassword - to unlock the keystore
        Returns:
        credential config
      • createKeyStoreCredentialConfig

        public static CredentialConfig createKeyStoreCredentialConfig​(java.security.KeyStore trustStore,
                                                                      java.lang.String[] trustStoreAliases,
                                                                      java.security.KeyStore keyStore,
                                                                      java.lang.String keyStorePassword,
                                                                      java.lang.String[] keyStoreAliases)
        Creates a KeyStoreCredentialConfig from the supplied truststore, keystore and password.
        Parameters:
        trustStore - to create credential config from
        trustStoreAliases - to use in the truststore
        keyStore - to create credential config from
        keyStorePassword - to unlock the keystore
        keyStoreAliases - to use in the keystore
        Returns:
        credential config
      • createX509CredentialConfig

        public static CredentialConfig createX509CredentialConfig​(java.security.cert.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​(java.security.cert.X509Certificate authenticationCertificate,
                                                                  java.security.PrivateKey authenticationKey)
        Creates a X509CredentialConfig from the supplied authentication certificate and private key.
        Parameters:
        authenticationCertificate - to create credential config from
        authenticationKey - that belongs to the certificate
        Returns:
        credential config
      • createX509CredentialConfig

        public static CredentialConfig createX509CredentialConfig​(java.security.cert.X509Certificate[] trustCertificates,
                                                                  java.security.cert.X509Certificate authenticationCertificate,
                                                                  java.security.PrivateKey authenticationKey)
        Creates a X509CredentialConfig from the supplied trust certificates, authentication certificate and private key.
        Parameters:
        trustCertificates - to create credential config from
        authenticationCertificate - to create credential config from
        authenticationKey - that belongs to the certificate
        Returns:
        credential config
      • createX509CredentialConfig

        public static CredentialConfig createX509CredentialConfig​(java.lang.String trustCertificates)
        Creates a X509CredentialConfig from PEM encoded certificate(s).
        Parameters:
        trustCertificates - to create credential config from
        Returns:
        credential config