public class SubjectAlternativeNameExtension extends Extension
Extensions are represented as a sequence of the extension identifier (Object Identifier), a boolean flag stating whether the extension is to be treated as being critical and the extension value itself (this is again a DER encoding of the extension value).
The ASN.1 syntax for this is:
SubjectAltName ::= GeneralNames GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName
Extension| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
NAME |
critical, extensionId, extensionValue| Constructor and Description |
|---|
SubjectAlternativeNameExtension(java.lang.Boolean critical,
GeneralNames names)
Create a SubjectAlternativeNameExtension with the specified
criticality and GeneralNames.
|
SubjectAlternativeNameExtension(java.lang.Boolean critical,
java.lang.Object value)
Create the extension from the passed DER encoded value.
|
SubjectAlternativeNameExtension(GeneralNames names)
Create a SubjectAlternativeNameExtension with the passed GeneralNames.
|
| Modifier and Type | Method and Description |
|---|---|
void |
encode(com.tencent.kona.sun.security.util.DerOutputStream out)
Write the extension to the OutputStream.
|
java.lang.String |
getName()
Return the name of this extension.
|
GeneralNames |
getNames()
Get the GeneralNames value.
|
java.lang.String |
toString()
Returns a printable representation of the SubjectAlternativeName.
|
encode, equals, getExtensionId, getExtensionValue, getId, getValue, hashCode, isCritical, newExtensionpublic static final java.lang.String NAME
public SubjectAlternativeNameExtension(GeneralNames names)
names - the GeneralNames for the subject.public SubjectAlternativeNameExtension(java.lang.Boolean critical,
GeneralNames names)
critical - true if the extension is to be treated as critical.names - the GeneralNames for the subject, cannot be null or empty.public SubjectAlternativeNameExtension(java.lang.Boolean critical,
java.lang.Object value)
throws java.io.IOException
critical - true if the extension is to be treated as critical.value - an array of DER encoded bytes of the actual value.java.lang.ClassCastException - if value is not an array of bytesjava.io.IOException - on error.public java.lang.String toString()
public void encode(com.tencent.kona.sun.security.util.DerOutputStream out)
public GeneralNames getNames()