Package com.unboundid.util.ssl.cert
Class GeneralAlternativeNameExtension
- java.lang.Object
-
- com.unboundid.util.ssl.cert.X509CertificateExtension
-
- com.unboundid.util.ssl.cert.GeneralAlternativeNameExtension
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
IssuerAlternativeNameExtension
,SubjectAlternativeNameExtension
@NotExtensible @ThreadSafety(level=COMPLETELY_THREADSAFE) public abstract class GeneralAlternativeNameExtension extends X509CertificateExtension
This class provides support for decoding the values of theSubjectAlternativeNameExtension
andIssuerAlternativeNameExtension
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:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
GeneralAlternativeNameExtension(OID oid, boolean isCritical, GeneralNames generalNames)
Creates a new general alternative name extension with the provided information.protected
GeneralAlternativeNameExtension(X509CertificateExtension extension)
Creates a new general alternative name extension from the provided generic extension.
-
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.GeneralNames
getGeneralNames()
Retrieves theGeneralNames
object for this alternative name extension.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.protected void
toString(java.lang.String extensionName, java.lang.StringBuilder buffer)
Appends a string representation of this extension to the provided buffer.-
Methods inherited from class com.unboundid.util.ssl.cert.X509CertificateExtension
getExtensionName, getOID, getValue, isCritical, toString, toString
-
-
-
-
Constructor Detail
-
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
protected GeneralAlternativeNameExtension(@NotNull X509CertificateExtension extension) throws CertException
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 Detail
-
getGeneralNames
@NotNull public final GeneralNames getGeneralNames()
Retrieves theGeneralNames
object for this alternative name extension.- Returns:
- The
GeneralNames
object for this alternative name extension.
-
getOtherNames
@NotNull public final java.util.List<ObjectPair<OID,ASN1Element>> getOtherNames()
Retrieves the otherName elements from the extension.- Returns:
- The otherName elements from the extension.
-
getRFC822Names
@NotNull public final 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
@NotNull public final java.util.List<java.lang.String> getDNSNames()
Retrieves the DNS names from the extension.- Returns:
- The DNS names from the extension.
-
getX400Addresses
@NotNull public final java.util.List<ASN1Element> getX400Addresses()
Retrieves the x400Address elements from the extension.- Returns:
- The x400Address elements from the extension.
-
getDirectoryNames
@NotNull public final java.util.List<DN> getDirectoryNames()
Retrieves the directory names from the extension.- Returns:
- The directory names from the extension.
-
getEDIPartyNames
@NotNull public final java.util.List<ASN1Element> getEDIPartyNames()
Retrieves the ediPartyName elements from the extensions.- Returns:
- The ediPartyName elements from the extension.
-
getUniformResourceIdentifiers
@NotNull public final java.util.List<java.lang.String> getUniformResourceIdentifiers()
Retrieves the uniform resource identifiers (URIs) from the extension.- Returns:
- The URIs from the extension.
-
getIPAddresses
@NotNull public final java.util.List<java.net.InetAddress> getIPAddresses()
Retrieves the IP addresses from the extension.- Returns:
- The IP addresses from the extension.
-
getRegisteredIDs
@NotNull public final java.util.List<OID> getRegisteredIDs()
Retrieves the registeredID elements from the extension.- Returns:
- The registeredID elements from the extension.
-
toString
protected void toString(@NotNull java.lang.String extensionName, @NotNull java.lang.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.
-
-