public abstract class CertificateChainCleaner extends 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 List<Certificate> |
clean(List<Certificate> chain,
String hostname) |
static CertificateChainCleaner |
get(X509Certificate... caCerts) |
static CertificateChainCleaner |
get(X509TrustManager trustManager) |
public abstract List<Certificate> clean(List<Certificate> chain, String hostname) throws SSLPeerUnverifiedException
SSLPeerUnverifiedException
public static CertificateChainCleaner get(X509TrustManager trustManager)
public static CertificateChainCleaner get(X509Certificate... caCerts)
Copyright © 2018. All rights reserved.