public class URIName extends java.lang.Object implements GeneralNameInterface
[RFC5280] When the subjectAltName extension contains a URI, the name MUST be stored in the uniformResourceIdentifier (an IA5String). The name MUST be a non-relative URL, and MUST follow the URL syntax and encoding rules specified in [RFC 3986]. The name must include both a scheme (e.g., "http" or "ftp") and a scheme-specific-part. The scheme- specific-part must include a fully qualified domain name or IP address as the host.
As specified in [RFC 3986], the scheme name is not case-sensitive (e.g., "http" is equivalent to "HTTP"). The host part is also not case-sensitive, but other components of the scheme-specific-part may be case-sensitive. When comparing URIs, conforming implementations MUST compare the scheme and host without regard to case, but assume the remainder of the scheme-specific-part is case-sensitive.
[RFC1738] In general, URLs are written as follows:
<scheme>:<scheme-specific-part>
A URL contains the name of the scheme being used (<scheme>) followed
by a colon and then a string (the <scheme-specific-part>) whose
interpretation depends on the scheme.
While the syntax for the rest of the URL may vary depending on the particular scheme selected, URL schemes that involve the direct use of an IP-based protocol to a specified host on the Internet use a common syntax for the scheme-specific data:
//<user>:<password>@<host>:<port>/<url-path>
[RFC2732] specifies that an IPv6 address contained inside a URL
must be enclosed in square brackets (to allow distinguishing the
colons that separate IPv6 components from the colons that separate
scheme-specific data.GeneralName,
GeneralNames,
GeneralNameInterfaceNAME_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 |
|---|
URIName(com.tencent.kona.sun.security.util.DerValue derValue)
Create the URIName object from the passed encoded Der value.
|
URIName(java.lang.String name)
Create the URIName 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 URI name into the DerOutputStream.
|
boolean |
equals(java.lang.Object obj)
Compares this name with another, for equality.
|
java.lang.String |
getHost()
Return the host name or IP address portion of the URIName
|
java.lang.Object |
getHostObject()
Return the host object type; if host name is a
DNSName, then this host object does not include any
initial "." on the name.
|
java.lang.String |
getName()
Returns this URI name.
|
java.lang.String |
getScheme()
Return the scheme name portion of a URIName
|
int |
getType()
Return the type of the GeneralName.
|
java.net.URI |
getURI()
Returns the URIName as a java.net.URI object
|
int |
hashCode()
Returns the hash code value for this object.
|
static URIName |
nameConstraint(com.tencent.kona.sun.security.util.DerValue value)
Create the URIName object with the specified name constraint.
|
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 URIName(com.tencent.kona.sun.security.util.DerValue derValue)
throws java.io.IOException
derValue - the encoded DER URIName.java.io.IOException - on error.public URIName(java.lang.String name)
throws java.io.IOException
name - the URIName.java.io.IOException - if name is not a proper URINamepublic static URIName nameConstraint(com.tencent.kona.sun.security.util.DerValue value) throws java.io.IOException
value - the URI name constraintjava.io.IOException - if name is not a proper URI name constraintpublic int getType()
getType in interface GeneralNameInterfacepublic 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 URIName to.public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.net.URI getURI()
public java.lang.String getName()
public java.lang.String getScheme()
public java.lang.String getHost()
public java.lang.Object getHostObject()
public int hashCode()
hashCode in class java.lang.Objectpublic int constrains(GeneralNameInterface inputName) throws java.lang.UnsupportedOperationException
RFC5280: For URIs, the constraint applies to the host part of the name. The constraint may specify a host or a domain. Examples would be "foo.bar.com"; and ".xyz.com". When the constraint begins with a period, it may be expanded with one or more subdomains. That is, the constraint ".xyz.com" is satisfied by both abc.xyz.com and abc.def.xyz.com. However, the constraint ".xyz.com" is not satisfied by "xyz.com". When the constraint does not begin with a period, it specifies a host.
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