public class SslConfiguration extends Object
Provides configuration for a key store and trust store for TLS certificate verification. Key store and trust store may be left unconfigured if the JDK trust store contains all necessary certificates to verify TLS certificates. The key store is used for Client Certificate authentication.
Resource
,
KeyStore
,
ClientCertificateAuthentication
Modifier and Type | Class and Description |
---|---|
static class |
SslConfiguration.KeyStoreConfiguration
Configuration for a key store/trust store.
|
Constructor and Description |
---|
SslConfiguration(Resource keyStore,
String keyStorePassword,
Resource trustStore,
String trustStorePassword)
Deprecated.
Since 1.1, use
SslConfiguration(KeyStoreConfiguration, KeyStoreConfiguration) to prevent
String interning and retaining passwords represented as String longer from
GC than necessary. |
SslConfiguration(SslConfiguration.KeyStoreConfiguration keyStoreConfiguration,
SslConfiguration.KeyStoreConfiguration trustStoreConfiguration)
Create a new
SslConfiguration . |
Modifier and Type | Method and Description |
---|---|
SslConfiguration |
create(Resource keyStore,
char[] keyStorePassword,
Resource trustStore,
char[] trustStorePassword)
Create a new
SslConfiguration for the given truststore with the default
KeyStore type. |
SslConfiguration |
create(Resource keyStore,
String keyStorePassword,
Resource trustStore,
String trustStorePassword)
Deprecated.
Since 1.1, use
create(Resource, char[], Resource, char[]) to
prevent String interning and retaining passwords represented as String
longer from GC than necessary. |
static SslConfiguration |
forKeyStore(Resource keyStore,
char[] keyStorePassword)
Create a new
SslConfiguration for the given key store with the default
KeyStore type. |
static SslConfiguration |
forKeyStore(Resource keyStore,
String keyStorePassword)
Deprecated.
Since 1.1, use
forKeyStore(Resource, char[]) to prevent
String interning and retaining passwords represented as String longer from
GC than necessary. |
static SslConfiguration |
forTrustStore(Resource trustStore,
char[] trustStorePassword)
Create a new
SslConfiguration for the given trust store with the default
KeyStore type. |
static SslConfiguration |
forTrustStore(Resource trustStore,
String trustStorePassword)
Deprecated.
Since 1.1, use
forTrustStore(Resource, char[]) to prevent
String interning and retaining passwords represented as String longer from
GC than necessary. |
Resource |
getKeyStore() |
SslConfiguration.KeyStoreConfiguration |
getKeyStoreConfiguration() |
String |
getKeyStorePassword()
Deprecated.
Since 1.1, use
SslConfiguration.KeyStoreConfiguration.getStorePassword() to
prevent String interning and retaining passwords represented as String
longer from GC than necessary. |
Resource |
getTrustStore() |
SslConfiguration.KeyStoreConfiguration |
getTrustStoreConfiguration() |
String |
getTrustStorePassword()
Deprecated.
Since 1.1, use
SslConfiguration.KeyStoreConfiguration.getStorePassword() to
prevent String interning and retaining passwords represented as String
longer from GC than necessary. |
static SslConfiguration |
unconfigured()
Factory method returning an unconfigured
SslConfiguration instance. |
SslConfiguration |
withKeyStore(SslConfiguration.KeyStoreConfiguration configuration)
Create a new
SslConfiguration with SslConfiguration.KeyStoreConfiguration applied
retaining the trust store configuration. |
SslConfiguration |
withTrustStore(SslConfiguration.KeyStoreConfiguration configuration)
Create a new
SslConfiguration with trust store
configuration applied retaining the getKeyStoreConfiguration() key store}
configuration. |
@Deprecated public SslConfiguration(Resource keyStore, @Nullable String keyStorePassword, Resource trustStore, @Nullable String trustStorePassword)
SslConfiguration(KeyStoreConfiguration, KeyStoreConfiguration)
to prevent
String
interning and retaining passwords represented as String longer from
GC than necessary.SslConfiguration
with the default KeyStore
type.keyStore
- the key store resource, must not be null.keyStorePassword
- the key store password.trustStore
- the trust store resource, must not be null.trustStorePassword
- the trust store password.public SslConfiguration(SslConfiguration.KeyStoreConfiguration keyStoreConfiguration, SslConfiguration.KeyStoreConfiguration trustStoreConfiguration)
SslConfiguration
.keyStoreConfiguration
- the key store configuration, must not be
null.trustStoreConfiguration
- the trust store configuration, must not be
null.@Deprecated public static SslConfiguration forTrustStore(Resource trustStore, @Nullable String trustStorePassword)
forTrustStore(Resource, char[])
to prevent
String
interning and retaining passwords represented as String longer from
GC than necessary.SslConfiguration
for the given trust store with the default
KeyStore
type.trustStore
- resource pointing to an existing trust store, must not be
null.trustStorePassword
- may be null.SslConfiguration
.KeyStore
public static SslConfiguration forTrustStore(Resource trustStore, @Nullable char[] trustStorePassword)
SslConfiguration
for the given trust store with the default
KeyStore
type.trustStore
- resource pointing to an existing trust store, must not be
null.trustStorePassword
- may be null.SslConfiguration
.KeyStore
@Deprecated public static SslConfiguration forKeyStore(Resource keyStore, @Nullable String keyStorePassword)
forKeyStore(Resource, char[])
to prevent
String
interning and retaining passwords represented as String longer from
GC than necessary.SslConfiguration
for the given key store with the default
KeyStore
type.keyStore
- resource pointing to an existing key store, must not be
null.keyStorePassword
- may be null.SslConfiguration
.KeyStore
public static SslConfiguration forKeyStore(@Nullable Resource keyStore, @Nullable char[] keyStorePassword)
SslConfiguration
for the given key store with the default
KeyStore
type.keyStore
- resource pointing to an existing key store, must not be
null.keyStorePassword
- may be null.SslConfiguration
.KeyStore
@Deprecated public SslConfiguration create(Resource keyStore, @Nullable String keyStorePassword, Resource trustStore, @Nullable String trustStorePassword)
create(Resource, char[], Resource, char[])
to
prevent String
interning and retaining passwords represented as String
longer from GC than necessary.SslConfiguration
for the given truststore with the default
KeyStore
type.keyStore
- resource pointing to an existing keystore, must not be
null.keyStorePassword
- may be null.trustStore
- resource pointing to an existing trust store, must not be
null.trustStorePassword
- may be null.SslConfiguration
.KeyStore
public SslConfiguration create(Resource keyStore, @Nullable char[] keyStorePassword, Resource trustStore, @Nullable char[] trustStorePassword)
SslConfiguration
for the given truststore with the default
KeyStore
type.keyStore
- resource pointing to an existing keystore, must not be
null.keyStorePassword
- may be null.trustStore
- resource pointing to an existing trust store, must not be
null.trustStorePassword
- may be null.SslConfiguration
.KeyStore
public static SslConfiguration unconfigured()
SslConfiguration
instance.SslConfiguration
instance.public Resource getKeyStore()
key store
resource or null if
not configured.@Deprecated @Nullable public String getKeyStorePassword()
SslConfiguration.KeyStoreConfiguration.getStorePassword()
to
prevent String
interning and retaining passwords represented as String
longer from GC than necessary.public SslConfiguration.KeyStoreConfiguration getKeyStoreConfiguration()
public SslConfiguration withKeyStore(SslConfiguration.KeyStoreConfiguration configuration)
SslConfiguration
with SslConfiguration.KeyStoreConfiguration
applied
retaining the trust store
configuration.configuration
- must not be null.SslConfiguration
with SslConfiguration.KeyStoreConfiguration
applied.public Resource getTrustStore()
key store
resource or null if
not configured.@Deprecated @Nullable public String getTrustStorePassword()
SslConfiguration.KeyStoreConfiguration.getStorePassword()
to
prevent String
interning and retaining passwords represented as String
longer from GC than necessary.public SslConfiguration.KeyStoreConfiguration getTrustStoreConfiguration()
public SslConfiguration withTrustStore(SslConfiguration.KeyStoreConfiguration configuration)
SslConfiguration
with trust store
configuration
applied retaining the getKeyStoreConfiguration()
key store}
configuration.configuration
- must not be null.SslConfiguration
with trust
store configuration
applied.Copyright © 2016–2018 Pivotal Software, Inc.. All rights reserved.