public class DNSName extends java.lang.Object implements GeneralNameInterface
[RFC5280] When the subjectAltName extension contains a domain name system label, the domain name MUST be stored in the dNSName (an IA5String). The name MUST be in the "preferred name syntax", as specified by Section 3.5 of [RFC1034] and as modified by Section 2.1 of [RFC1123]. Note that while uppercase and lowercase letters are allowed in domain names, no significance is attached to the case. In addition, while the string " " is a legal domain name, subjectAltName extensions with a dNSName of " " MUST NOT be used. Finally, the use of the DNS representation for Internet mail addresses (subscriber.example.com instead of subscriber@example.com) MUST NOT be used; such identities are to be encoded as rfc822Name.
NAME_ANY, NAME_DIFF_TYPE, NAME_DIRECTORY, NAME_DNS, NAME_EDI, NAME_IP, NAME_MATCH, NAME_NARROWS, NAME_OID, NAME_RFC822, NAME_SAME_TYPE, NAME_URI, NAME_WIDENS, NAME_X400| Constructor and Description |
|---|
DNSName(com.tencent.kona.sun.security.util.DerValue derValue)
Create the DNSName object from the passed encoded Der value.
|
DNSName(java.lang.String name)
Create the DNSName object with the specified name.
|
DNSName(java.lang.String name,
boolean allowWildcard)
Create the DNSName object with the specified name.
|
| Modifier and Type | Method and Description |
|---|---|
int |
constrains(GeneralNameInterface inputName)
Return type of constraint inputName places on this name:
NAME_DIFF_TYPE = -1: input name is different type from name (i.e.
|
void |
encode(com.tencent.kona.sun.security.util.DerOutputStream out)
Encode the DNSName into the DerOutputStream.
|
boolean |
equals(java.lang.Object obj)
Compares this name with another, for equality.
|
java.lang.String |
getName()
Return the actual name value of the GeneralName.
|
int |
getType()
Return the type of the GeneralName.
|
int |
hashCode()
Returns the hash code value for this object.
|
int |
subtreeDepth()
Return subtree depth of this name for purposes of determining
NameConstraints minimum and maximum bounds and for calculating
path lengths in name subtrees.
|
java.lang.String |
toString()
Convert the name into user readable string.
|
public DNSName(com.tencent.kona.sun.security.util.DerValue derValue)
throws java.io.IOException
derValue - the encoded DER DNSName.java.io.IOException - on error.public DNSName(java.lang.String name,
boolean allowWildcard)
throws java.io.IOException
name - the DNSName.allowWildcard - the flag for wildcard checking.java.io.IOException - if the name is not a valid DNSNamepublic DNSName(java.lang.String name)
throws java.io.IOException
name - the DNSName.java.io.IOException - if the name is not a valid DNSNamepublic int getType()
getType in interface GeneralNameInterfacepublic java.lang.String getName()
public void encode(com.tencent.kona.sun.security.util.DerOutputStream out)
encode in interface com.tencent.kona.sun.security.util.DerEncoderout - the DER stream to encode the DNSName to.public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic int constrains(GeneralNameInterface inputName) throws java.lang.UnsupportedOperationException
RFC5280: DNS name restrictions are expressed as host.example.com. Any DNS name that can be constructed by simply adding zero or more labels to the left-hand side of the name satisfies the name constraint. For example, www.host.example.com would satisfy the constraint but host1.example.com would not.
RFC 5280: DNSName restrictions are expressed as foo.bar.com. Any DNSName that can be constructed by simply adding to the left-hand side of the name satisfies the name constraint. For example, www.foo.bar.com would satisfy the constraint but foo1.bar.com would not.
RFC1034: By convention, domain names can be stored with arbitrary case, but domain name comparisons for all present domain functions are done in a case-insensitive manner, assuming an ASCII character set, and a high order zero bit.
constrains in interface GeneralNameInterfaceinputName - to be checked for being constrainedjava.lang.UnsupportedOperationException - if name is not exact match, but narrowing and widening are
not supported for this name type.public int subtreeDepth()
throws java.lang.UnsupportedOperationException
subtreeDepth in interface GeneralNameInterfacejava.lang.UnsupportedOperationException - if not supported for this name type