public class DNSName extends java.lang.Object implements sun.security.x509.GeneralNameInterface
[RFC2459] When the subjectAltName extension contains a domain name service label, the domain name MUST be stored in the dNSName (an IA5String). The name MUST be in the "preferred name syntax," as specified by RFC 1034 [RFC 1034]. Note that while upper and lower case letters are allowed in domain names, no signifigance is attached to the case. In addition, while the string " " is a legal domain name, subjectAltName extensions with a dNSName " " are not permitted. Finally, the use of the DNS representation for Internet mail addresses (wpolk.nist.gov instead of wpolk@nist.gov) is not permitted; such identities are to be encoded as rfc822Name. This class has been copied from OpenJDK7u repository and modified in order to fix Java bug 8016345: https://bugs.openjdk.java.net/browse/JDK-8016345 It can be deleted after a migration to a Java release fixing this bug.
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
alpha |
private static java.lang.String |
alphaDigitsAndHyphen |
private static java.lang.String |
digitsAndHyphen |
private java.lang.String |
name |
Constructor and Description |
---|
DNSName(java.lang.String name)
Create the DNSName object with the specified name.
|
Modifier and Type | Method and Description |
---|---|
int |
constrains(sun.security.x509.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(sun.security.util.DerOutputStream out)
Encode the DNS name 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.
|
private final java.lang.String name
private static final java.lang.String alpha
private static final java.lang.String digitsAndHyphen
private static final java.lang.String alphaDigitsAndHyphen
public DNSName(java.lang.String name) throws java.io.IOException
name
- the DNSName.java.io.IOException
- if the name is not a valid DNSName subjectAltNamepublic int getType()
getType
in interface sun.security.x509.GeneralNameInterface
public java.lang.String getName()
public void encode(sun.security.util.DerOutputStream out) throws java.io.IOException
encode
in interface sun.security.x509.GeneralNameInterface
out
- the DER stream to encode the DNSName to.java.io.IOException
- on encoding errors.public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public int constrains(sun.security.x509.GeneralNameInterface inputName)
RFC2459: DNS name restrictions are expressed as foo.bar.com. Any subdomain satisfies the name constraint. For example, www.foo.bar.com would satisfy the constraint but bigfoo.bar.com would not.
draft-ietf-pkix-new-part1-00.txt: DNS name restrictions are expressed as foo.bar.com. Any DNS name 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 sun.security.x509.GeneralNameInterface
inputName
- 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()
subtreeDepth
in interface sun.security.x509.GeneralNameInterface
java.lang.UnsupportedOperationException
- if not supported for this name type