AbstractVerifier.Verify Method

Definition

Overloads

Name Description
Verify(String, X509Certificate)

Verifies a hostname against the names in an X.509 certificate.

Verify(String, ISSLSession)

Verifies that the specified hostname is allowed within the specified SSL session.

Verify(String, SSLSocket)

Verifies a hostname against the peer certificate of an SSL socket.

Verify(String, String[], String[])

Checks to see if the supplied hostname matches any of the supplied CNs or "DNS" Subject-Alts.

Verify(String, String[], String[], Boolean)

Verifies a hostname against certificate common names and DNS subject alternative names.

Verify(String, X509Certificate)

Verifies a hostname against the names in an X.509 certificate.

[Android.Runtime.Register("verify", "(Ljava/lang/String;Ljava/security/cert/X509Certificate;)V", "")]
public void Verify(string? host, Java.Security.Cert.X509Certificate? cert);
[<Android.Runtime.Register("verify", "(Ljava/lang/String;Ljava/security/cert/X509Certificate;)V", "")>]
abstract member Verify : string * Java.Security.Cert.X509Certificate -> unit
override this.Verify : string * Java.Security.Cert.X509Certificate -> unit

Parameters

host
String

The hostname to verify.

cert
X509Certificate

The certificate whose names are verified.

Implements

Attributes

Exceptions

Remarks

Portions of this page are based on work created and shared by the Apache Software Foundation and used under the terms of the Apache License, Version 2.0.

Applies to

Verify(String, ISSLSession)

Verifies that the specified hostname is allowed within the specified SSL session.

[Android.Runtime.Register("verify", "(Ljava/lang/String;Ljavax/net/ssl/SSLSession;)Z", "")]
public bool Verify(string? host, Javax.Net.Ssl.ISSLSession? session);
[<Android.Runtime.Register("verify", "(Ljava/lang/String;Ljavax/net/ssl/SSLSession;)Z", "")>]
abstract member Verify : string * Javax.Net.Ssl.ISSLSession -> bool
override this.Verify : string * Javax.Net.Ssl.ISSLSession -> bool

Parameters

host
String

the hostname.

session
ISSLSession

the SSL session of the connection.

Returns

true if the hostname matches the certificate presented by the session; otherwise, false.

Implements

Attributes

Remarks

Portions of this page are based on work created and shared by the Apache Software Foundation and used under the terms of the Apache License, Version 2.0.

Applies to

Verify(String, SSLSocket)

Verifies a hostname against the peer certificate of an SSL socket.

[Android.Runtime.Register("verify", "(Ljava/lang/String;Ljavax/net/ssl/SSLSocket;)V", "")]
public void Verify(string? host, Javax.Net.Ssl.SSLSocket? ssl);
[<Android.Runtime.Register("verify", "(Ljava/lang/String;Ljavax/net/ssl/SSLSocket;)V", "")>]
abstract member Verify : string * Javax.Net.Ssl.SSLSocket -> unit
override this.Verify : string * Javax.Net.Ssl.SSLSocket -> unit

Parameters

host
String

The hostname to verify.

ssl
SSLSocket

The SSL socket whose peer certificate is verified.

Implements

Attributes

Exceptions

Remarks

Portions of this page are based on work created and shared by the Apache Software Foundation and used under the terms of the Apache License, Version 2.0.

Applies to

Verify(String, String[], String[])

Checks to see if the supplied hostname matches any of the supplied CNs or "DNS" Subject-Alts.

[Android.Runtime.Register("verify", "(Ljava/lang/String;[Ljava/lang/String;[Ljava/lang/String;)V", "GetVerify_Ljava_lang_String_arrayLjava_lang_String_arrayLjava_lang_String_Handler")]
public abstract void Verify(string? host, string[]? cns, string[]? subjectAlts);
[<Android.Runtime.Register("verify", "(Ljava/lang/String;[Ljava/lang/String;[Ljava/lang/String;)V", "GetVerify_Ljava_lang_String_arrayLjava_lang_String_arrayLjava_lang_String_Handler")>]
abstract member Verify : string * string[] * string[] -> unit

Parameters

host
String

The hostname to verify.

cns
String[]

CN fields, in order, as extracted from the X.509 certificate.

subjectAlts
String[]

Subject-Alt fields of type 2 ("DNS"), as extracted from the X.509 certificate.

Implements

Attributes

Remarks

Checks to see if the supplied hostname matches any of the supplied CNs or "DNS" Subject-Alts. Most implementations only look at the first CN, and ignore any additional CNs. Most implementations do look at all of the "DNS" Subject-Alts. The CNs or Subject-Alts may contain wildcards according to RFC 2818.

Java documentation for org.apache.http.conn.ssl.X509HostnameVerifier.verify(java.lang.String, java.lang.String[], java.lang.String[]).

Portions of this page are based on work created and shared by the Apache Software Foundation and used under the terms of the Apache License, Version 2.0.

Applies to

Verify(String, String[], String[], Boolean)

Verifies a hostname against certificate common names and DNS subject alternative names.

[Android.Runtime.Register("verify", "(Ljava/lang/String;[Ljava/lang/String;[Ljava/lang/String;Z)V", "")]
public void Verify(string? host, string[]? cns, string[]? subjectAlts, bool strictWithSubDomains);
[<Android.Runtime.Register("verify", "(Ljava/lang/String;[Ljava/lang/String;[Ljava/lang/String;Z)V", "")>]
member this.Verify : string * string[] * string[] * bool -> unit

Parameters

host
String

The hostname to verify.

cns
String[]

The common-name fields extracted from the certificate.

subjectAlts
String[]

The DNS subject-alternative-name fields extracted from the certificate.

strictWithSubDomains
Boolean

true to require wildcard matches at the same subdomain level; otherwise, false.

Attributes

Exceptions

Remarks

Portions of this page are based on work created and shared by the Apache Software Foundation and used under the terms of the Apache License, Version 2.0.

Applies to