Most visited

Recently visited

Added in API level 1
Deprecated since API level 22

AbstractVerifier

public abstract class AbstractVerifier
extends Object implements X509HostnameVerifier

java.lang.Object
    org.apache.http.conn.ssl.AbstractVerifier
Known Direct Subclasses


这个类在API级别22已被弃用。
请改用openConnection() 请访问this webpage了解更多详情。

所有标准 X509HostnameVerifier实现的抽象基类。

摘要(Summary)

Public constructors

AbstractVerifier()

公共方法(Public methods)

static boolean acceptableCountryWildcard(String cn)
static int countDots(String s)

计算点数“。” 在一个字符串中。

static String[] getCNs(X509Certificate cert)
static String[] getDNSSubjectAlts(X509Certificate cert)

从X509Certificate中提取SubjectAlt DNS名称的数组。

final void verify(String host, SSLSocket ssl)
final void verify(String host, String[] cns, String[] subjectAlts, boolean strictWithSubDomains)
final void verify(String host, X509Certificate cert)
final boolean verify(String host, SSLSession session)

验证主机名是否与服务器的验证方案匹配。

继承方法(Inherited methods)

From class java.lang.Object
From interface org.apache.http.conn.ssl.X509HostnameVerifier
From interface javax.net.ssl.HostnameVerifier

Public constructors

AbstractVerifier

Added in API level 1
AbstractVerifier ()

公共方法(Public methods)

acceptableCountryWildcard

Added in API level 1
boolean acceptableCountryWildcard (String cn)

参数(Parameters)
cn String
返回(Returns)
boolean

countDots

Added in API level 1
int countDots (String s)

计算点数“。” 在一个字符串中。

参数(Parameters)
s String: string to count dots from
返回(Returns)
int number of dots

getCNs

Added in API level 1
String[] getCNs (X509Certificate cert)

参数(Parameters)
cert X509Certificate
返回(Returns)
String[]

getDNSSubjectAlts

Added in API level 1
String[] getDNSSubjectAlts (X509Certificate cert)

从X509Certificate中提取SubjectAlt DNS名称的数组。 如果没有,则返回null。

Note: Java doesn't appear able to extract international characters from the SubjectAlts. It can only extract international characters from the CN field.

(Or maybe the version of OpenSSL I'm using to test isn't storing the international characters correctly in the SubjectAlts?).

参数(Parameters)
cert X509Certificate: X509Certificate
返回(Returns)
String[] Array of SubjectALT DNS names stored in the certificate.

verify

Added in API level 1
void verify (String host, 
                SSLSocket ssl)

参数(Parameters)
host String
ssl SSLSocket
抛出异常(Throws)
IOException

verify

Added in API level 1
void verify (String host, 
                String[] cns, 
                String[] subjectAlts, 
                boolean strictWithSubDomains)

参数(Parameters)
host String
cns String
subjectAlts String
strictWithSubDomains boolean
抛出异常(Throws)
SSLException

verify

Added in API level 1
void verify (String host, 
                X509Certificate cert)

参数(Parameters)
host String
cert X509Certificate
抛出异常(Throws)
SSLException

verify

Added in API level 1
boolean verify (String host, 
                SSLSession session)

验证主机名是否与服务器的验证方案匹配。

参数(Parameters)
host String: the host name
session SSLSession: SSLSession used on the connection to host
返回(Returns)
boolean true if the host name is acceptable

Hooray!