Class AbstractCBLTrustManager
- java.lang.Object
-
- com.couchbase.lite.internal.replicator.AbstractCBLTrustManager
-
- All Implemented Interfaces:
TrustManager
,X509TrustManager
- Direct Known Subclasses:
CBLTrustManager
public abstract class AbstractCBLTrustManager extends Object implements X509TrustManager
The trust manager that supports the followings: 1. Supports pinned server certificate. 2. Supports acceptOnlySelfSignedServerCertificate mode. 3. Supports default trust manager for validating certs when the pinned server certificate and acceptOnlySelfSignedServerCertificate are not used. 4. Allows to listen for the server certificates.
-
-
Constructor Summary
Constructors Constructor Description AbstractCBLTrustManager(byte[] pinnedServerCert, boolean acceptOnlySelfSignedServerCertificate, Fn.Consumer<List<Certificate>> serverCertsListener)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkClientTrusted(X509Certificate[] chain, String authType)
void
checkServerTrusted(X509Certificate[] chain, String authType)
X509Certificate[]
getAcceptedIssuers()
-
-
-
Constructor Detail
-
AbstractCBLTrustManager
public AbstractCBLTrustManager(@Nullable byte[] pinnedServerCert, boolean acceptOnlySelfSignedServerCertificate, @NonNull Fn.Consumer<List<Certificate>> serverCertsListener)
-
-
Method Detail
-
getAcceptedIssuers
@NonNull public X509Certificate[] getAcceptedIssuers()
- Specified by:
getAcceptedIssuers
in interfaceX509TrustManager
-
checkClientTrusted
public void checkClientTrusted(@Nullable X509Certificate[] chain, @Nullable String authType)
- Specified by:
checkClientTrusted
in interfaceX509TrustManager
-
checkServerTrusted
public void checkServerTrusted(@Nullable X509Certificate[] chain, @Nullable String authType) throws CertificateException
- Specified by:
checkServerTrusted
in interfaceX509TrustManager
- Throws:
CertificateException
-
-