Class GeneralName

  • All Implemented Interfaces:
    java.io.Serializable, GeneralNameInterface

    public class GeneralName
    extends java.lang.Object
    implements GeneralNameInterface
    This class implements the ASN.1 GeneralName object class.

    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
     }
     
    Version:
    1.7
    Author:
    Amit Kapoor, Hemma Prafullchandra
    See Also:
    Serialized Form
    • Constructor Detail

      • GeneralName

        public GeneralName​(GeneralNameInterface name)
        Default constructor for the class.
        Parameters:
        name - the selected CHOICE from the list.
      • GeneralName

        public GeneralName​(DerValue encName)
                    throws java.io.IOException
        Create the object from its DER encoded value.
        Parameters:
        encName - the DER encoded GeneralName.
        Throws:
        java.io.IOException
    • Method Detail

      • toString

        public java.lang.String toString()
        Return the name as user readable string
        Overrides:
        toString in class java.lang.Object
      • encode

        public void encode​(DerOutputStream out)
                    throws java.io.IOException
        Encode the name to the specified DerOutputStream.
        Specified by:
        encode in interface GeneralNameInterface
        Parameters:
        out - the DerOutputStream to encode the the GeneralName to.
        Throws:
        java.io.IOException - on encoding errors.
      • validSingle

        public boolean validSingle()
        Description copied from interface: GeneralNameInterface
        Whether the name is valid as a single name (e.g. for use in Subject Alternative Name extension).
        Specified by:
        validSingle in interface GeneralNameInterface
      • unwrap

        public GeneralNameInterface unwrap()
        Unwrap this GeneralName until we reach something that is not a GeneralName.