/** * 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); }
@Override public void checkClientTrusted(final X509Certificate[] chain, final String authType) throws CertificateException { checkCertificateTrusted(chain[0]); }
/** * Creates a new {@link KeyStore} with the default keystore type and initializes it. * * @return initialized keystore * * @throws GeneralSecurityException if the keystore cannot be initialized */ public static KeyStore newInstance() throws GeneralSecurityException { return newInstance(DEFAULT_TYPE); }
/** * Creates a KeyStoreCredentialConfig from the supplied keystore and password. * * @param keyStore to create credential config from * @param keyStorePassword to unlock the keystore * * @return credential config */ public static CredentialConfig createKeyStoreCredentialConfig(final KeyStore keyStore, final String keyStorePassword) { return createKeyStoreCredentialConfig(null, null, keyStore, keyStorePassword, null); }
@Override public void setSslConfig(final SslConfig config) { THREAD_LOCAL_SSL_CONFIG.set(config); }
@Override public SslConfig getSslConfig() { return THREAD_LOCAL_SSL_CONFIG.get(); }
/** * Removes the ssl config from the current thread-local value. */ public void removeSslConfig() { THREAD_LOCAL_SSL_CONFIG.remove(); }
@Override public void checkClientTrusted(final X509Certificate[] chain, final String authType) throws CertificateException { checkCertificateTrusted(chain[0]); }
/** * 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 KeyStoreCredentialConfig from the supplied truststore. * * @param trustStore to create credential config from * * @return credential config */ public static CredentialConfig createKeyStoreCredentialConfig(final KeyStore trustStore) { return createKeyStoreCredentialConfig(trustStore, null, null, null, null); }
/** * Creates a new {@link KeyStore} with the default keystore type and initializes it. * * @return initialized keystore * * @throws GeneralSecurityException if the keystore cannot be initialized */ public static KeyStore newInstance() throws GeneralSecurityException { return newInstance(DEFAULT_TYPE); }
@Override public void setSslConfig(final SslConfig config) { THREAD_LOCAL_SSL_CONFIG.set(config); }
@Override public SslConfig getSslConfig() { return THREAD_LOCAL_SSL_CONFIG.get(); }
/** * Removes the ssl config from the current thread-local value. */ public void removeSslConfig() { THREAD_LOCAL_SSL_CONFIG.remove(); }
@Override public void checkClientTrusted(final X509Certificate[] chain, final String authType) throws CertificateException { checkCertificateTrusted(chain[0]); }
/** * Creates a KeyStoreCredentialConfig from the supplied keystore and password. * * @param keyStore to create credential config from * @param keyStorePassword to unlock the keystore * * @return credential config */ public static CredentialConfig createKeyStoreCredentialConfig(final KeyStore keyStore, final String keyStorePassword) { return createKeyStoreCredentialConfig(null, null, keyStore, keyStorePassword, null); }
/** * Creates a new {@link KeyStore} with the default keystore type and initializes it. * * @return initialized keystore * * @throws GeneralSecurityException if the keystore cannot be initialized */ public static KeyStore newInstance() throws GeneralSecurityException { return newInstance(DEFAULT_TYPE); }
@Override public void checkServerTrusted(final X509Certificate[] chain, final String authType) throws CertificateException { checkCertificateTrusted(chain[0]); }
/** * Creates a KeyStoreCredentialConfig from the supplied keystore and password. * * @param keyStore to create credential config from * @param keyStorePassword to unlock the keystore * * @return credential config */ public static CredentialConfig createKeyStoreCredentialConfig(final KeyStore keyStore, final String keyStorePassword) { return createKeyStoreCredentialConfig(null, null, keyStore, keyStorePassword, null); }
@Override public void checkServerTrusted(final X509Certificate[] chain, final String authType) throws CertificateException { checkCertificateTrusted(chain[0]); }