public class CertificateAuthenticator extends Object implements Authenticator
| Modifier and Type | Method and Description |
|---|---|
void |
applyTlsProperties(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)
Creates a new
CertificateAuthenticator from a key store path. |
static CertificateAuthenticator |
fromKeyStore(Path keyStorePath,
String keyStorePassword,
String keyStoreType)
Creates a new
CertificateAuthenticator from a key store path. |
boolean |
requiresTls()
If this authenticator only works with encrypted connections.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitauthKeyValueConnectionpublic static CertificateAuthenticator fromKeyStore(Path keyStorePath, String keyStorePassword)
CertificateAuthenticator from a key store path.
Assumes the file format is readable by KeyStore.getDefaultType()
(this typically includes JKS and PKCS12).
keyStorePath - the file path to the keystore.keyStorePassword - the password for the keystore.CertificateAuthenticator.public static CertificateAuthenticator fromKeyStore(Path keyStorePath, String keyStorePassword, String keyStoreType)
CertificateAuthenticator from a key store path.keyStorePath - the file path to the keystore.keyStorePassword - the password for the keystore.keyStoreType - (nullable) the type of the key store. If null, 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(io.netty.handler.ssl.SslContextBuilder context)
AuthenticatorapplyTlsProperties in interface Authenticatorcontext - the netty context builderpublic boolean requiresTls()
AuthenticatorrequiresTls in interface AuthenticatorCopyright © 2021 Couchbase, Inc.. All rights reserved.