Package com.couchbase.lite
Class MultipeerCertificateAuthenticator
java.lang.Object
com.couchbase.lite.internal.core.BaseMultipeerCertificateAuthenticator
com.couchbase.lite.MultipeerCertificateAuthenticator
- All Implemented Interfaces:
MultipeerAuthenticator
public final class MultipeerCertificateAuthenticator
extends com.couchbase.lite.internal.core.BaseMultipeerCertificateAuthenticator
The authenticator authenticates the peer by verifying the peer’s certificate.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceDelegate interface for custom authentication logic. -
Constructor Summary
ConstructorsConstructorDescriptionMultipeerCertificateAuthenticator(MultipeerCertificateAuthenticator.AuthenticationDelegate delegate) Initialize with an authenticator for verifying the received certificate chain.MultipeerCertificateAuthenticator(List<X509Certificate> rootCerts) Initialize with the root certificates to trust. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanauthenticate(PeerInfo.PeerId peer, List<X509Certificate> certs) Authenticates the peer certificates.
-
Constructor Details
-
MultipeerCertificateAuthenticator
Initialize with the root certificates to trust.- Parameters:
rootCerts- certificate chain to use for authentication.
-
MultipeerCertificateAuthenticator
public MultipeerCertificateAuthenticator(@NonNull MultipeerCertificateAuthenticator.AuthenticationDelegate delegate) Initialize with an authenticator for verifying the received certificate chain.- Parameters:
delegate- The delegate to use for authentication.
-
-
Method Details
-
authenticate
Authenticates the peer certificates.- Specified by:
authenticatein classcom.couchbase.lite.internal.core.BaseMultipeerCertificateAuthenticator- Parameters:
peer- The peer ID.certs- certs to be authenticated- Returns:
- true if the authentication is successful, false otherwise.
-