public class IPAddressName extends java.lang.Object implements GeneralNameInterface
[RFC2459 4.2.1.7 Subject Alternative Name] When the subjectAltName extension contains a iPAddress, the address MUST be stored in the octet string in "network byte order," as specified in RFC 791. The least significant bit (LSB) of each octet is the LSB of the corresponding byte in the network address. For IP Version 4, as specified in RFC 791, the octet string MUST contain exactly four octets. For IP Version 6, as specified in RFC 1883, the octet string MUST contain exactly sixteen octets.
[RFC2459 4.2.1.11 Name Constraints] The syntax of iPAddress MUST be as described in section 4.2.1.7 with the following additions specifically for Name Constraints. For IPv4 addresses, the ipAddress field of generalName MUST contain eight (8) octets, encoded in the style of RFC 1519 (CIDR) to represent an address range.[RFC 1519] For IPv6 addresses, the ipAddress field MUST contain 32 octets similarly encoded. For example, a name constraint for "class C" subnet 10.9.8.0 shall be represented as the octets 0A 09 08 00 FF FF FF 00, representing the CIDR notation 10.9.8.0/255.255.255.0.
GeneralName,
GeneralNameInterface,
GeneralNamesNAME_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 |
|---|
IPAddressName(byte[] address)
Create the IPAddressName object with the specified octets.
|
IPAddressName(DerValue derValue)
Create the IPAddressName object from the passed encoded Der value.
|
IPAddressName(java.lang.String name)
Create an IPAddressName from a String.
|
| 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(DerOutputStream out)
Encode the IPAddress name into the DerOutputStream.
|
boolean |
equals(java.lang.Object obj)
Compares this name with another, for equality.
|
byte[] |
getBytes()
Returns this IPAddress name as a byte array.
|
java.lang.String |
getName()
Return a standard String representation of IPAddress.
|
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()
Return a printable string of IPaddress
|
public IPAddressName(DerValue derValue) throws java.io.IOException
java.io.IOException - on error.public IPAddressName(byte[] address)
throws java.io.IOException
java.io.IOException - if address is not a valid IPv4 or IPv6 addresspublic IPAddressName(java.lang.String name)
throws java.io.IOException
[IETF RFC2373 IP Version 6 Addressing Architecture] For IPv6 addresses, the forms are "a1:a2:...:a8" or "a1:a2:...:a8/n", where a1-a8 are hexadecimal values representing the eight 16-bit pieces of the address. If /n is used, n is a decimal number indicating how many of the leftmost contiguous bits of the address comprise the prefix for this subnet. Internally, a mask value is created using the prefix length.
name - String form of IPAddressNamejava.io.IOException - if name can not be converted to a valid IPv4 or IPv6
addresspublic int getType()
getType in interface GeneralNameInterfacepublic void encode(DerOutputStream out) throws java.io.IOException
encode in interface GeneralNameInterfaceout - the DerOutputStream to encode the GeneralName to.java.io.IOException - on encoding errors.public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getName()
throws java.io.IOException
java.io.IOException - if the IPAddress cannot be converted to a Stringpublic byte[] getBytes()
public 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
[RFC2459] The syntax of iPAddress MUST be as described in section 4.2.1.7 with the following additions specifically for Name Constraints. For IPv4 addresses, the ipAddress field of generalName MUST contain eight (8) octets, encoded in the style of RFC 1519 (CIDR) to represent an address range.[RFC 1519] For IPv6 addresses, the ipAddress field MUST contain 32 octets similarly encoded. For example, a name constraint for "class C" subnet 10.9.8.0 shall be represented as the octets 0A 09 08 00 FF FF FF 00, representing the CIDR notation 10.9.8.0/255.255.255.0.
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 typeCopyright © 2020. All Rights Reserved.