public class GeneralName extends java.lang.Object implements GeneralNameInterface
The ASN.1 syntax for this is:
GeneralName ::= CHOICE {
otherName [0] OtherName,
rfc822Name [1] IA5String,
dNSName [2] IA5String,
x400Address [3] ORAddress,
directoryName [4] Name,
ediPartyName [5] EDIPartyName,
uniformResourceIdentifier [6] IA5String,
iPAddress [7] OCTET STRING,
registeredID [8] OBJECT IDENTIFIER
}
NAME_ANY, NAME_DIRECTORY, NAME_DNS, NAME_EDI, NAME_IP, NAME_OID, NAME_RFC822, NAME_URI, NAME_X400| Constructor and Description |
|---|
GeneralName(DerValue encName)
Create the object from its DER encoded value.
|
GeneralName(GeneralNameInterface name)
Default constructor for the class.
|
| Modifier and Type | Method and Description |
|---|---|
void |
encode(DerOutputStream out)
Encode the name to the specified DerOutputStream.
|
int |
getType()
Return the type of the general name.
|
java.lang.String |
toString()
Return the name as user readable string
|
GeneralNameInterface |
unwrap()
Unwrap this GeneralName until we reach something that is not
a GeneralName.
|
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)
|
public GeneralName(GeneralNameInterface name)
name - the selected CHOICE from the list.public GeneralName(DerValue encName) throws java.io.IOException
encName - the DER encoded GeneralName.java.io.IOExceptionpublic int getType()
getType in interface GeneralNameInterfacepublic java.lang.String toString()
toString in class java.lang.Objectpublic void encode(DerOutputStream out) throws java.io.IOException
encode in interface GeneralNameInterfaceout - the DerOutputStream to encode the the GeneralName to.java.io.IOException - on encoding errors.public boolean validSingle()
GeneralNameInterfacevalidSingle in interface GeneralNameInterfacepublic boolean validSubtree()
GeneralNameInterfacevalidSubtree in interface GeneralNameInterfacepublic GeneralNameInterface unwrap()