public final class CertificatePinner extends Object
TrustManager不接受自签名证书,
则CertificatePinner不能用于pin自签名证书| Modifier and Type | Class and Description |
|---|---|
static class |
CertificatePinner.Builder
构建已配置的证书
|
| Modifier and Type | Field and Description |
|---|---|
static CertificatePinner |
DEFAULT |
| Modifier and Type | Method and Description |
|---|---|
void |
check(String hostname,
List<Certificate> peerCertificates)
确认
hostname所固定的证书中至少有一个位于peerCertificates中。
如果没有为hostname指定证书,则不执行任何操作。Httpd在成功的TLS握手之后调用它,但是在使用连接之前. |
boolean |
equals(Object other) |
int |
hashCode() |
static String |
pin(Certificate certificate) |
CertificatePinner |
withCertificateChainCleaner(CertificateChainCleaner certificateChainCleaner) |
public static final CertificatePinner DEFAULT
public static String pin(Certificate certificate)
public void check(String hostname, List<Certificate> peerCertificates) throws SSLPeerUnverifiedException
hostname所固定的证书中至少有一个位于peerCertificates中。
如果没有为hostname指定证书,则不执行任何操作。Httpd在成功的TLS握手之后调用它,但是在使用连接之前.hostname - 主机名peerCertificates - 证书信息SSLPeerUnverifiedException - 如果peerCertificates
与hostname所固定的证书不匹配public CertificatePinner withCertificateChainCleaner(CertificateChainCleaner certificateChainCleaner)
Copyright © 2020. All rights reserved.