Class GeneralAlternativeNameExtension

java.lang.Object
com.unboundid.util.ssl.cert.X509CertificateExtension
com.unboundid.util.ssl.cert.GeneralAlternativeNameExtension
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
IssuerAlternativeNameExtension, SubjectAlternativeNameExtension

This class provides support for decoding the values of the SubjectAlternativeNameExtension and IssuerAlternativeNameExtension extensions as described in RFC 5280 sections 4.2.1.6 and 4.2.1.7.

Note that this implementation only provides complete decoding for the RFC 822 names (email addresses), DNS names, directory names, uniform resource identifiers, and IP addresses elements. The other elements will be left in their raw forms.

The value has the following encoding:
   SubjectAltName ::= GeneralNames

   IssuerAltName ::= GeneralNames

   GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName

   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 }

   OtherName ::= SEQUENCE {
        type-id    OBJECT IDENTIFIER,
        value      [0] EXPLICIT ANY DEFINED BY type-id }

   EDIPartyName ::= SEQUENCE {
        nameAssigner            [0]     DirectoryString OPTIONAL,
        partyName               [1]     DirectoryString }
 
See Also:
  • Constructor Details

    • GeneralAlternativeNameExtension

      protected GeneralAlternativeNameExtension(@NotNull OID oid, boolean isCritical, @NotNull GeneralNames generalNames) throws CertException
      Creates a new general alternative name extension with the provided information.
      Parameters:
      oid - The OID for this extension.
      isCritical - Indicates whether this extension should be considered critical.
      generalNames - The general names for inclusion in this extension.
      Throws:
      CertException - If a problem is encountered while encoding the value for this extension.
    • GeneralAlternativeNameExtension

      Creates a new general alternative name extension from the provided generic extension.
      Parameters:
      extension - The extension to decode as a general alternative name extension.
      Throws:
      CertException - If the provided extension cannot be decoded as a general alternative name extension.
  • Method Details

    • getGeneralNames

      Retrieves the GeneralNames object for this alternative name extension.
      Returns:
      The GeneralNames object for this alternative name extension.
    • getOtherNames

      Retrieves the otherName elements from the extension.
      Returns:
      The otherName elements from the extension.
    • getRFC822Names

      Retrieves the RFC 822 names (email addresses) from the extension.
      Returns:
      The RFC 822 names from the extension.
    • getDNSNames

      @NotNull public final List<String> getDNSNames()
      Retrieves the DNS names from the extension.
      Returns:
      The DNS names from the extension.
    • getX400Addresses

      Retrieves the x400Address elements from the extension.
      Returns:
      The x400Address elements from the extension.
    • getDirectoryNames

      @NotNull public final List<DN> getDirectoryNames()
      Retrieves the directory names from the extension.
      Returns:
      The directory names from the extension.
    • getEDIPartyNames

      Retrieves the ediPartyName elements from the extensions.
      Returns:
      The ediPartyName elements from the extension.
    • getUniformResourceIdentifiers

      Retrieves the uniform resource identifiers (URIs) from the extension.
      Returns:
      The URIs from the extension.
    • getIPAddresses

      Retrieves the IP addresses from the extension.
      Returns:
      The IP addresses from the extension.
    • getRegisteredIDs

      @NotNull public final List<OID> getRegisteredIDs()
      Retrieves the registeredID elements from the extension.
      Returns:
      The registeredID elements from the extension.
    • toString

      protected void toString(@NotNull String extensionName, @NotNull StringBuilder buffer)
      Appends a string representation of this extension to the provided buffer.
      Parameters:
      extensionName - The name to use for this extension.
      buffer - The buffer to which the information should be appended.