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 | Field and Description |
---|---|
static SslConfiguration |
NONE
Default
SslConfiguration without a KeyStore/TrustStore configured. |
Constructor and Description |
---|
SslConfiguration(Resource keyStore,
String keyStorePassword,
Resource trustStore,
String trustStorePassword) |
Modifier and Type | Method and Description |
---|---|
SslConfiguration |
create(Resource keyStore,
String keyStorePassword,
Resource trustStore,
String trustStorePassword)
Creates a new
SslConfiguration for the given truststore. |
static SslConfiguration |
forKeyStore(Resource keyStore,
String keyStorePassword)
Creates a new
SslConfiguration for the given key store. |
static SslConfiguration |
forTrustStore(Resource trustStore,
String trustStorePassword)
Creates a new
SslConfiguration for the given trust store. |
Resource |
getKeyStore() |
String |
getKeyStorePassword() |
Resource |
getTrustStore() |
String |
getTrustStorePassword() |
public static final SslConfiguration NONE
SslConfiguration
without a KeyStore/TrustStore configured.public static SslConfiguration forTrustStore(Resource trustStore, String trustStorePassword)
SslConfiguration
for the given trust store.trustStore
- resource pointing to an existing trust store, must not be null.trustStorePassword
- may be null.KeyStore
public static SslConfiguration forKeyStore(Resource keyStore, String keyStorePassword)
SslConfiguration
for the given key store.keyStore
- resource pointing to an existing key store, must not be null.keyStorePassword
- may be null.KeyStore
public SslConfiguration create(Resource keyStore, String keyStorePassword, Resource trustStore, String trustStorePassword)
SslConfiguration
for the given truststore.keyStore
- resource pointing to an existing keystore, must not be null.keyStorePassword
- may be null.KeyStore
public Resource getKeyStore()
key store
resource or null if not configured.public String getKeyStorePassword()
public Resource getTrustStore()
key store
resource or null if not configured.public String getTrustStorePassword()
Copyright © 2016 Pivotal Software, Inc.. All rights reserved.