public class IPAddressName extends java.lang.Object implements GeneralNameInterface
GeneralName
,
GeneralNameInterface
,
GeneralNames
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected static char |
IPv4_LEN |
protected static char |
IPv6_LEN |
NAME_ANY, NAME_DIRECTORY, NAME_DNS, NAME_EDI, NAME_IP, NAME_OID, NAME_RFC822, NAME_URI, NAME_X400
Constructor and Description |
---|
IPAddressName(byte[] address)
Create the IPAddressName object with the specified name.
|
IPAddressName(DerValue derValue)
Create the IPAddressName object from the passed encoded Der value.
|
IPAddressName(java.lang.String s)
Create the IPAddressName object with a string representing the
ip address.
|
IPAddressName(java.lang.String s,
CIDRNetmask mask)
IP address with CIDR netmask
|
IPAddressName(java.lang.String s,
java.lang.String netmask)
Create the IPAddressName object with a string representing the
ip address and a string representing the netmask, with encoding
having ip address encoding followed by the netmask encoding.
|
Modifier and Type | Method and Description |
---|---|
void |
encode(DerOutputStream out)
Encode the IPAddress name into the DerOutputStream.
|
static int |
fillIPv4Address(java.lang.String s,
byte[] address,
int start)
Gets an IP v4 address in the form n.n.n.n.
|
static int |
fillIPv6Address(java.lang.String s,
byte[] address,
int start)
Gets an IP address in the forms as defined in RFC1884:
x:x:x:x:x:x:x:x ... |
int |
getType()
Return the type of the GeneralName.
|
java.lang.String |
toString()
Return a printable string of IPaddress
|
boolean |
validSingle()
Whether the name is valid as a single name (e.g. for use in
Subject Alternative Name extension).
|
boolean |
validSubtree()
Whether the name is valid as a subtree name (e.g. for use in
Name Constraints extension)
|
protected static final char IPv4_LEN
protected static final char IPv6_LEN
public IPAddressName(DerValue derValue) throws java.io.IOException
derValue
- the encoded DER IPAddressName.java.io.IOException
- on error.public IPAddressName(byte[] address)
address
- the IPAddressName.public IPAddressName(java.lang.String s, java.lang.String netmask)
s
- the ip address in the format: n.n.n.n or x:x:x:x:x:x:x:x (RFC 1884)netmask
- the netmask address in the format: n.n.n.n or x:x:x:x:x:x:x:x (RFC 1884)public IPAddressName(java.lang.String s, CIDRNetmask mask)
s
- a single IPv4 or IPv6 addressmask
- a CIDR netmaskpublic IPAddressName(java.lang.String s)
s
- the ip address in the format: n.n.n.n or x:x:x:x:x:x:x:xpublic int getType()
getType
in interface GeneralNameInterface
public boolean validSingle()
GeneralNameInterface
validSingle
in interface GeneralNameInterface
public boolean validSubtree()
GeneralNameInterface
validSubtree
in interface GeneralNameInterface
public void encode(DerOutputStream out) throws java.io.IOException
encode
in interface GeneralNameInterface
out
- the DER stream to encode the IPAddressName to.java.io.IOException
- on encoding errors.public java.lang.String toString()
toString
in class java.lang.Object
public static int fillIPv4Address(java.lang.String s, byte[] address, int start)
public static int fillIPv6Address(java.lang.String s, byte[] address, int start)