/** * Creates a X509CredentialConfig from the supplied trust certificates. * * @param trustCertificates to create credential config from * * @return credential config */ public static CredentialConfig createX509CredentialConfig(final X509Certificate[] trustCertificates) { return createX509CredentialConfig(trustCertificates, null, null); }
/** * Creates a X509CredentialConfig from the supplied trust certificates. * * @param trustCertificates to create credential config from * * @return credential config */ public static CredentialConfig createX509CredentialConfig(final X509Certificate[] trustCertificates) { return createX509CredentialConfig(trustCertificates, null, null); }
/** * Creates a X509CredentialConfig from the supplied trust certificates. * * @param trustCertificates to create credential config from * * @return credential config */ public static CredentialConfig createX509CredentialConfig(final X509Certificate[] trustCertificates) { return createX509CredentialConfig(trustCertificates, null, null); }
/** * Creates a X509CredentialConfig from the supplied authentication certificate and private key. * * @param authenticationCertificate to create credential config from * @param authenticationKey that belongs to the certificate * * @return credential config */ public static CredentialConfig createX509CredentialConfig( final X509Certificate authenticationCertificate, final PrivateKey authenticationKey) { return createX509CredentialConfig(null, authenticationCertificate, authenticationKey); }
/** * Creates a X509CredentialConfig from the supplied authentication certificate and private key. * * @param authenticationCertificate to create credential config from * @param authenticationKey that belongs to the certificate * * @return credential config */ public static CredentialConfig createX509CredentialConfig( final X509Certificate authenticationCertificate, final PrivateKey authenticationKey) { return createX509CredentialConfig(null, authenticationCertificate, authenticationKey); }
/** * Creates a X509CredentialConfig from the supplied authentication certificate and private key. * * @param authenticationCertificate to create credential config from * @param authenticationKey that belongs to the certificate * * @return credential config */ public static CredentialConfig createX509CredentialConfig( final X509Certificate authenticationCertificate, final PrivateKey authenticationKey) { return createX509CredentialConfig(null, authenticationCertificate, authenticationKey); }
/** {@inheritDoc} */ @Override protected CredentialConfig doCreateInstance() throws Exception { X509Certificate[] trustCerts = null; if (trustCredential != null) { if (trustCredential instanceof X509Credential) { final X509Credential cred = (X509Credential) trustCredential; trustCerts = cred.getEntityCertificateChain().toArray( new X509Certificate[cred.getEntityCertificateChain().size()]); } else { log.error("Supplied StartTLSTrustCredential was of type {}, not {}", trustCredential.getClass() .getName(), X509Credential.class.getName()); throw new BeanCreationException("Supplied StartTLSTrustCredential was of wrong type"); } } X509Certificate authCert = null; PrivateKey authKey = null; if (authCredential != null) { if (authCredential instanceof X509Credential) { final X509Credential cred = (X509Credential) authCredential; authCert = cred.getEntityCertificate(); authKey = cred.getPrivateKey(); } else { log.error("Supplied StartTLSAuthenticationCredential was of type {}, not {}", authCredential.getClass().getName(), X509Credential.class.getName()); throw new BeanCreationException("Supplied StartTLSAuthenticationCredential was of wrong type"); } } return CredentialConfigFactory.createX509CredentialConfig(trustCerts, authCert, authKey); }