Package nl.altindag.ssl
Class SSLFactory.Builder
- java.lang.Object
-
- nl.altindag.ssl.SSLFactory.Builder
-
- Enclosing class:
- SSLFactory
public static class SSLFactory.Builder extends Object
-
-
Method Summary
-
-
-
Method Detail
-
withSystemTrustMaterial
public SSLFactory.Builder withSystemTrustMaterial()
-
withDefaultTrustMaterial
public SSLFactory.Builder withDefaultTrustMaterial()
-
withSystemPropertyDerivedTrustMaterial
public SSLFactory.Builder withSystemPropertyDerivedTrustMaterial()
-
withUnsafeTrustMaterial
public SSLFactory.Builder withUnsafeTrustMaterial()
A shorter method for using the unsafe trust material- Returns:
SSLFactory.Builder
- See Also:
withTrustingAllCertificatesWithoutValidation()
-
withDummyTrustMaterial
public SSLFactory.Builder withDummyTrustMaterial()
-
withSwappableTrustMaterial
public SSLFactory.Builder withSwappableTrustMaterial()
Enables the possibility to swap the underlying TrustManager at runtime. After this option has been enabled the TrustManager can be swapped withTrustManagerUtils#swapTrustManager(swappableTrustManager, newTrustManager)
- Returns:
SSLFactory.Builder
-
withLoggingTrustMaterial
public SSLFactory.Builder withLoggingTrustMaterial()
-
withTrustMaterial
public <T extends X509TrustManager> SSLFactory.Builder withTrustMaterial(T trustManager)
-
withTrustMaterial
public <T extends ManagerFactoryParameters> SSLFactory.Builder withTrustMaterial(T managerFactoryParameters)
-
withTrustMaterial
public <T extends X509TrustManager> SSLFactory.Builder withTrustMaterial(T trustManager, TrustStoreTrustOptions<? extends CertPathTrustManagerParameters> trustOptions)
-
withTrustMaterial
public <T extends TrustManagerFactory> SSLFactory.Builder withTrustMaterial(T trustManagerFactory)
-
withTrustMaterial
public SSLFactory.Builder withTrustMaterial(String trustStorePath, char[] trustStorePassword)
-
withTrustMaterial
public SSLFactory.Builder withTrustMaterial(String trustStorePath, char[] trustStorePassword, TrustStoreTrustOptions<? extends CertPathTrustManagerParameters> trustOptions)
-
withTrustMaterial
public SSLFactory.Builder withTrustMaterial(String trustStorePath, char[] trustStorePassword, String trustStoreType)
-
withTrustMaterial
public SSLFactory.Builder withTrustMaterial(String trustStorePath, char[] trustStorePassword, String trustStoreType, TrustStoreTrustOptions<? extends CertPathTrustManagerParameters> trustOptions)
-
withTrustMaterial
public SSLFactory.Builder withTrustMaterial(Path trustStorePath, char[] trustStorePassword)
-
withTrustMaterial
public SSLFactory.Builder withTrustMaterial(Path trustStorePath, char[] trustStorePassword, TrustStoreTrustOptions<? extends CertPathTrustManagerParameters> trustOptions)
-
withTrustMaterial
public SSLFactory.Builder withTrustMaterial(Path trustStorePath, char[] trustStorePassword, String trustStoreType)
-
withTrustMaterial
public SSLFactory.Builder withTrustMaterial(Path trustStorePath, char[] trustStorePassword, String trustStoreType, TrustStoreTrustOptions<? extends CertPathTrustManagerParameters> trustOptions)
-
withTrustMaterial
public SSLFactory.Builder withTrustMaterial(InputStream trustStoreStream, char[] trustStorePassword)
-
withTrustMaterial
public SSLFactory.Builder withTrustMaterial(InputStream trustStoreStream, char[] trustStorePassword, TrustStoreTrustOptions<? extends CertPathTrustManagerParameters> trustOptions)
-
withTrustMaterial
public SSLFactory.Builder withTrustMaterial(InputStream trustStoreStream, char[] trustStorePassword, String trustStoreType)
-
withTrustMaterial
public SSLFactory.Builder withTrustMaterial(InputStream trustStoreStream, char[] trustStorePassword, String trustStoreType, TrustStoreTrustOptions<? extends CertPathTrustManagerParameters> trustOptions)
-
withTrustMaterial
public SSLFactory.Builder withTrustMaterial(KeyStore trustStore)
-
withTrustMaterial
public SSLFactory.Builder withTrustMaterial(KeyStore trustStore, TrustStoreTrustOptions<? extends CertPathTrustManagerParameters> trustOptions)
-
withTrustMaterial
public SSLFactory.Builder withTrustMaterial(Set<X509Certificate> certificates, TrustAnchorTrustOptions<? extends CertPathTrustManagerParameters> trustOptions)
-
withTrustMaterial
@SafeVarargs public final <T extends Certificate> SSLFactory.Builder withTrustMaterial(T... certificates)
-
withTrustMaterial
public final <T extends Certificate> SSLFactory.Builder withTrustMaterial(T[] certificates, TrustStoreTrustOptions<? extends CertPathTrustManagerParameters> trustOptions)
-
withTrustMaterial
public <T extends Certificate> SSLFactory.Builder withTrustMaterial(List<T> certificates)
-
withTrustMaterial
public <T extends Certificate> SSLFactory.Builder withTrustMaterial(List<T> certificates, TrustStoreTrustOptions<? extends CertPathTrustManagerParameters> trustOptions)
-
withSystemPropertyDerivedIdentityMaterial
public SSLFactory.Builder withSystemPropertyDerivedIdentityMaterial()
-
withIdentityMaterial
public SSLFactory.Builder withIdentityMaterial(String identityStorePath, char[] identityStorePassword)
-
withIdentityMaterial
public SSLFactory.Builder withIdentityMaterial(String identityStorePath, char[] identityStorePassword, char[] identityPassword)
-
withIdentityMaterial
public SSLFactory.Builder withIdentityMaterial(String identityStorePath, char[] identityStorePassword, String identityStoreType)
-
withIdentityMaterial
public SSLFactory.Builder withIdentityMaterial(String identityStorePath, char[] identityStorePassword, char[] identityPassword, String identityStoreType)
-
withIdentityMaterial
public SSLFactory.Builder withIdentityMaterial(Path identityStorePath, char[] identityStorePassword)
-
withIdentityMaterial
public SSLFactory.Builder withIdentityMaterial(Path identityStorePath, char[] identityStorePassword, char[] identityPassword)
-
withIdentityMaterial
public SSLFactory.Builder withIdentityMaterial(Path identityStorePath, char[] identityStorePassword, String identityStoreType)
-
withIdentityMaterial
public SSLFactory.Builder withIdentityMaterial(Path identityStorePath, char[] identityStorePassword, char[] identityPassword, String identityStoreType)
-
withIdentityMaterial
public SSLFactory.Builder withIdentityMaterial(InputStream identityStream, char[] identityStorePassword)
-
withIdentityMaterial
public SSLFactory.Builder withIdentityMaterial(InputStream identityStream, char[] identityStorePassword, char[] identityPassword)
-
withIdentityMaterial
public SSLFactory.Builder withIdentityMaterial(InputStream identityStream, char[] identityStorePassword, String identityStoreType)
-
withIdentityMaterial
public SSLFactory.Builder withIdentityMaterial(InputStream identityStream, char[] identityStorePassword, char[] identityPassword, String identityStoreType)
-
withIdentityMaterial
public SSLFactory.Builder withIdentityMaterial(KeyStore identityStore, char[] identityPassword)
-
withIdentityMaterial
@SafeVarargs public final <T extends Certificate> SSLFactory.Builder withIdentityMaterial(Key privateKey, char[] privateKeyPassword, T... certificateChain)
-
withIdentityMaterial
@SafeVarargs public final <T extends Certificate> SSLFactory.Builder withIdentityMaterial(Key privateKey, char[] privateKeyPassword, String alias, T... certificateChain)
-
withIdentityMaterial
public final <T extends Certificate> SSLFactory.Builder withIdentityMaterial(Key privateKey, char[] privateKeyPassword, List<T> certificateChain)
-
withIdentityMaterial
public final <T extends Certificate> SSLFactory.Builder withIdentityMaterial(Key privateKey, char[] privateKeyPassword, String alias, List<T> certificateChain)
-
withIdentityMaterial
public <T extends X509KeyManager> SSLFactory.Builder withIdentityMaterial(T keyManager)
-
withIdentityMaterial
public <T extends KeyManagerFactory> SSLFactory.Builder withIdentityMaterial(T keyManagerFactory)
-
withDummyIdentityMaterial
public SSLFactory.Builder withDummyIdentityMaterial()
-
withSwappableIdentityMaterial
public SSLFactory.Builder withSwappableIdentityMaterial()
Enables the possibility to swap the underlying KeyManager at runtime. After this option has been enabled the KeyManager can be swapped withKeyManagerUtils#swapKeyManager(swappableKeyManager, newKeyManager)
- Returns:
SSLFactory.Builder
-
withLoggingIdentityMaterial
public SSLFactory.Builder withLoggingIdentityMaterial()
-
withInflatableTrustMaterial
public SSLFactory.Builder withInflatableTrustMaterial()
-
withInflatableTrustMaterial
@Deprecated public SSLFactory.Builder withInflatableTrustMaterial(Path trustStorePath, char[] trustStorePassword, String trustStoreType, BiPredicate<X509Certificate[],String> certificateAndAuthTypeTrustPredicate)
Deprecated.
-
withInflatableTrustMaterial
public SSLFactory.Builder withInflatableTrustMaterial(Path trustStorePath, char[] trustStorePassword, String trustStoreType, Predicate<TrustManagerParameters> trustManagerParametersPredicate)
-
withIdentityRoute
public SSLFactory.Builder withIdentityRoute(String alias, String... hosts)
-
withIdentityRoute
public SSLFactory.Builder withIdentityRoute(Map<String,List<String>> aliasesToHosts)
-
withHostnameVerifier
public <T extends HostnameVerifier> SSLFactory.Builder withHostnameVerifier(T hostnameVerifier)
-
withUnsafeHostnameVerifier
public SSLFactory.Builder withUnsafeHostnameVerifier()
-
withHostnameVerifierEnhancer
public SSLFactory.Builder withHostnameVerifierEnhancer(Predicate<HostnameVerifierParameters> hostnameVerifierParametersValidator)
-
withCiphers
public SSLFactory.Builder withCiphers(String... ciphers)
-
withSystemPropertyDerivedCiphers
public SSLFactory.Builder withSystemPropertyDerivedCiphers()
-
withProtocols
public SSLFactory.Builder withProtocols(String... protocols)
-
withSystemPropertyDerivedProtocols
public SSLFactory.Builder withSystemPropertyDerivedProtocols()
-
withNeedClientAuthentication
public SSLFactory.Builder withNeedClientAuthentication()
-
withNeedClientAuthentication
public SSLFactory.Builder withNeedClientAuthentication(boolean needClientAuthentication)
-
withWantClientAuthentication
public SSLFactory.Builder withWantClientAuthentication()
-
withWantClientAuthentication
public SSLFactory.Builder withWantClientAuthentication(boolean wantClientAuthentication)
-
withSessionTimeout
public SSLFactory.Builder withSessionTimeout(int timeoutInSeconds)
-
withSessionCacheSize
public SSLFactory.Builder withSessionCacheSize(int cacheSizeInBytes)
-
withSslContextAlgorithm
public SSLFactory.Builder withSslContextAlgorithm(String sslContextAlgorithm)
-
withSecurityProvider
public <T extends Provider> SSLFactory.Builder withSecurityProvider(T securityProvider)
-
withSecurityProvider
public SSLFactory.Builder withSecurityProvider(String securityProviderName)
-
withSecureRandom
public <T extends SecureRandom> SSLFactory.Builder withSecureRandom(T secureRandom)
-
withTrustingAllCertificatesWithoutValidation
public SSLFactory.Builder withTrustingAllCertificatesWithoutValidation()
-
withTrustEnhancer
@Deprecated public SSLFactory.Builder withTrustEnhancer(ChainAndAuthTypeValidator validator)
Deprecated.
-
withTrustEnhancer
@Deprecated public SSLFactory.Builder withTrustEnhancer(ChainAndAuthTypeWithSocketValidator validator)
Deprecated.
-
withTrustEnhancer
@Deprecated public SSLFactory.Builder withTrustEnhancer(ChainAndAuthTypeWithSSLEngineValidator validator)
Deprecated.
-
withTrustEnhancer
public SSLFactory.Builder withTrustEnhancer(Predicate<TrustManagerParameters> validator)
-
build
public SSLFactory build()
-
-