Package org.conscrypt
Class CertPinManager
- java.lang.Object
-
- org.conscrypt.CertPinManager
-
public class CertPinManager extends Object
This class provides a simple interface for cert pinning.
-
-
Constructor Summary
Constructors Constructor Description CertPinManager(String path, TrustedCertificateStore store)Test onlyCertPinManager(TrustedCertificateStore store)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisChainValid(String hostname, List<X509Certificate> chain)Given ahostnameand achainthis verifies that the certificate chain includes certificates from the pinned list iff thehostnameis on the list of sites that should be pinned.
-
-
-
Constructor Detail
-
CertPinManager
public CertPinManager(TrustedCertificateStore store) throws org.conscrypt.PinManagerException
- Throws:
org.conscrypt.PinManagerException
-
CertPinManager
public CertPinManager(String path, TrustedCertificateStore store) throws org.conscrypt.PinManagerException
Test only- Throws:
org.conscrypt.PinManagerException
-
-
Method Detail
-
isChainValid
public boolean isChainValid(String hostname, List<X509Certificate> chain) throws org.conscrypt.PinManagerException
Given ahostnameand achainthis verifies that the certificate chain includes certificates from the pinned list iff thehostnameis on the list of sites that should be pinned.If
chaindoesn't include those certificates and enforcing mode is enabled, then this method returnsfalseand the certificate chain validation should fail.- Throws:
org.conscrypt.PinManagerException
-
-