public abstract class CertificateChainCleaner
extends java.lang.Object
chain[0]
, each
certificate is signed by the certificate that follows, and the last certificate is a trusted CA
certificate.
Use of the chain cleaner is necessary to omit unexpected certificates that aren't relevant to the TLS handshake and to extract the trusted CA certificate for the benefit of certificate pinning.
Constructor and Description |
---|
CertificateChainCleaner() |
Modifier and Type | Method and Description |
---|---|
abstract java.util.List<java.security.cert.Certificate> |
clean(java.util.List<java.security.cert.Certificate> chain,
java.lang.String hostname) |
static CertificateChainCleaner |
get(java.security.cert.X509Certificate... caCerts) |
static CertificateChainCleaner |
get(javax.net.ssl.X509TrustManager trustManager) |
public abstract java.util.List<java.security.cert.Certificate> clean(java.util.List<java.security.cert.Certificate> chain, java.lang.String hostname) throws javax.net.ssl.SSLPeerUnverifiedException
javax.net.ssl.SSLPeerUnverifiedException
public static CertificateChainCleaner get(javax.net.ssl.X509TrustManager trustManager)
public static CertificateChainCleaner get(java.security.cert.X509Certificate... caCerts)