Class GeneralNames

  • All Implemented Interfaces:
    java.io.Serializable

    @NotMutable
    @ThreadSafety(level=COMPLETELY_THREADSAFE)
    public final class GeneralNames
    extends java.lang.Object
    implements java.io.Serializable
    This class provides a data structure that represents a GeneralNames element that may appear in a number of X.509 certificate extensions, including SubjectAlternativeNameExtension, IssuerAlternativeNameExtension, AuthorityKeyIdentifierExtension, and CRLDistributionPointsExtension. The GeneralNames element has the following encoding (as described in RFC 5280 section 4.2.1.6):
       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:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<DN> getDirectoryNames()
      Retrieves the directory names from the extension.
      java.util.List<java.lang.String> getDNSNames()
      Retrieves the DNS names from the extension.
      java.util.List<ASN1Element> getEDIPartyNames()
      Retrieves the ediPartyName elements from the extensions.
      java.util.List<java.net.InetAddress> getIPAddresses()
      Retrieves the IP addresses from the extension.
      java.util.List<ObjectPair<OID,​ASN1Element>> getOtherNames()
      Retrieves the otherName elements from the extension.
      java.util.List<OID> getRegisteredIDs()
      Retrieves the registeredID elements from the extension.
      java.util.List<java.lang.String> getRFC822Names()
      Retrieves the RFC 822 names (email addresses) from the extension.
      java.util.List<java.lang.String> getUniformResourceIdentifiers()
      Retrieves the uniform resource identifiers (URIs) from the extension.
      java.util.List<ASN1Element> getX400Addresses()
      Retrieves the x400Address elements from the extension.
      java.lang.String toString()
      Retrieves a string representation of this general names element.
      void toString​(java.lang.StringBuilder buffer)
      Appends a string representation of this general names element to the provided buffer.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • getOtherNames

        public java.util.List<ObjectPair<OID,​ASN1Element>> getOtherNames()
        Retrieves the otherName elements from the extension.
        Returns:
        The otherName elements from the extension.
      • getRFC822Names

        public java.util.List<java.lang.String> getRFC822Names()
        Retrieves the RFC 822 names (email addresses) from the extension.
        Returns:
        The RFC 822 names from the extension.
      • getDNSNames

        public java.util.List<java.lang.String> getDNSNames()
        Retrieves the DNS names from the extension.
        Returns:
        The DNS names from the extension.
      • getX400Addresses

        public java.util.List<ASN1ElementgetX400Addresses()
        Retrieves the x400Address elements from the extension.
        Returns:
        The x400Address elements from the extension.
      • getDirectoryNames

        public java.util.List<DNgetDirectoryNames()
        Retrieves the directory names from the extension.
        Returns:
        The directory names from the extension.
      • getEDIPartyNames

        public java.util.List<ASN1ElementgetEDIPartyNames()
        Retrieves the ediPartyName elements from the extensions.
        Returns:
        The ediPartyName elements from the extension.
      • getUniformResourceIdentifiers

        public java.util.List<java.lang.String> getUniformResourceIdentifiers()
        Retrieves the uniform resource identifiers (URIs) from the extension.
        Returns:
        The URIs from the extension.
      • getIPAddresses

        public java.util.List<java.net.InetAddress> getIPAddresses()
        Retrieves the IP addresses from the extension.
        Returns:
        The IP addresses from the extension.
      • getRegisteredIDs

        public java.util.List<OIDgetRegisteredIDs()
        Retrieves the registeredID elements from the extension.
        Returns:
        The registeredID elements from the extension.
      • toString

        public java.lang.String toString()
        Retrieves a string representation of this general names element.
        Overrides:
        toString in class java.lang.Object
        Returns:
        A string representation of this general names element.
      • toString

        public void toString​(java.lang.StringBuilder buffer)
        Appends a string representation of this general names element to the provided buffer.
        Parameters:
        buffer - The buffer to which the information should be appended.