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:
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 the
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:
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 Summary
ConstructorsModifierConstructorDescriptionprotectedGeneralAlternativeNameExtension(OID oid, boolean isCritical, GeneralNames generalNames) Creates a new general alternative name extension with the provided information.protectedCreates a new general alternative name extension from the provided generic extension. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the directory names from the extension.Retrieves the DNS names from the extension.final List<ASN1Element> Retrieves the ediPartyName elements from the extensions.final GeneralNamesRetrieves theGeneralNamesobject for this alternative name extension.final List<InetAddress> Retrieves the IP addresses from the extension.final List<ObjectPair<OID, ASN1Element>> Retrieves the otherName elements from the extension.Retrieves the registeredID elements from the extension.Retrieves the RFC 822 names (email addresses) from the extension.Retrieves the uniform resource identifiers (URIs) from the extension.final List<ASN1Element> Retrieves the x400Address elements from the extension.protected voidtoString(String extensionName, 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 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
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 Details
-
getGeneralNames
Retrieves theGeneralNamesobject for this alternative name extension.- Returns:
- The
GeneralNamesobject 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
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
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
Retrieves the registeredID elements from the extension.- Returns:
- The registeredID elements from the extension.
-
toString
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.
-