public class CertificateAuthenticator extends Object implements Authenticator
Modifier and Type | Method and Description |
---|---|
void |
applyTlsProperties(com.couchbase.client.core.deps.io.netty.handler.ssl.SslContextBuilder context)
The authenticator gets the chance to attach the client certificate to the ssl context if needed.
|
static CertificateAuthenticator |
fromKey(PrivateKey key,
String keyPassword,
List<X509Certificate> keyCertChain)
Creates a new
CertificateAuthenticator directly from a key and certificate chain. |
static CertificateAuthenticator |
fromKeyManagerFactory(Supplier<KeyManagerFactory> keyManagerFactory)
Creates a new
CertificateAuthenticator from a KeyManagerFactory . |
static CertificateAuthenticator |
fromKeyStore(KeyStore keyStore,
String keyStorePassword)
Creates a new
CertificateAuthenticator from a key store. |
static CertificateAuthenticator |
fromKeyStore(Path keyStorePath,
String keyStorePassword,
Optional<String> keyStoreType)
Creates a new
CertificateAuthenticator from a key store path. |
boolean |
supportsNonTls()
If this authenticator supports non-encrypted connections.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
authHttpRequest, authKeyValueConnection, supportsTls
public static CertificateAuthenticator fromKeyStore(Path keyStorePath, String keyStorePassword, Optional<String> keyStoreType)
CertificateAuthenticator
from a key store path.keyStorePath
- the file path to the keystore.keyStorePassword
- the password for the keystore.keyStoreType
- the type of the key store. If empty, the KeyStore.getDefaultType()
will be used.CertificateAuthenticator
.public static CertificateAuthenticator fromKeyStore(KeyStore keyStore, String keyStorePassword)
CertificateAuthenticator
from a key store.keyStore
- the key store to load the certificate from.keyStorePassword
- the password for the key store.CertificateAuthenticator
.public static CertificateAuthenticator fromKeyManagerFactory(Supplier<KeyManagerFactory> keyManagerFactory)
CertificateAuthenticator
from a KeyManagerFactory
.keyManagerFactory
- the key manager factory in a supplier that should be used.CertificateAuthenticator
.public static CertificateAuthenticator fromKey(PrivateKey key, String keyPassword, List<X509Certificate> keyCertChain)
CertificateAuthenticator
directly from a key and certificate chain.key
- the private key to authenticate.keyPassword
- the password for to use.keyCertChain
- the key certificate chain to use.CertificateAuthenticator
.public void applyTlsProperties(com.couchbase.client.core.deps.io.netty.handler.ssl.SslContextBuilder context)
Authenticator
applyTlsProperties
in interface Authenticator
context
- the netty context builderpublic boolean supportsNonTls()
Authenticator
supportsNonTls
in interface Authenticator
Copyright © 2020 Couchbase, Inc.. All rights reserved.