public class JsseDefaultHostnameAuthorizer extends Object implements JsseHostnameAuthorizer
Constructor and Description |
---|
JsseDefaultHostnameAuthorizer(Set<String> knownSuffixes)
Base constructor.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
isValidNameMatch(String name,
String dnsName,
Set<String> suffixes) |
boolean |
verified(String name,
SSLSession context)
Verify the passed in host name according to the context object.
|
boolean |
verify(String name,
X509Certificate cert) |
public JsseDefaultHostnameAuthorizer(Set<String> knownSuffixes)
The authorizer attempts to perform matching (including the use of the wildcard) in accordance with RFC 6125.
Known suffixes is a list of public domain suffixes that can't be used as wild cards for example *.com, or c*c.com, as a dns wildcard could match every/most .com domains if a registrar were issue it. If *.com is in the known suffixes list will not be allowed to match.
knownSuffixes
- a set of suffixes that cannot be wild-carded, e.g. { ".com", ".net", ".org" }public boolean verified(String name, SSLSession context) throws IOException
JsseHostnameAuthorizer
verified
in interface JsseHostnameAuthorizer
name
- name of the host to be verified.context
- context object to do the verification under.IOException
public boolean verify(String name, X509Certificate cert) throws IOException
IOException
public static boolean isValidNameMatch(String name, String dnsName, Set<String> suffixes) throws IOException
IOException
Copyright © 2021 BouncyCastle.org. All rights reserved.