APIdia Launch Partner
Top Description Fields Constructors Methods
sun.security.x509

public Class SubjectAlternativeNameExtension

extends Extension
Class Inheritance
Imports
java.io.IOException, sun.security.util.*

This represents the Subject Alternative Name Extension. This extension, if present, allows the subject to specify multiple alternative names.

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
Authors
Amit Kapoor, Hemma Prafullchandra
See Also
Extension

Field Summary

Modifier and TypeField and Description
public static final String
pack-priv GeneralNames
Inherited from sun.security.x509.Extension:
criticalextensionIdextensionValue

Constructor Summary

AccessConstructor and Description
public
SubjectAlternativeNameExtension(GeneralNames
the GeneralNames for the subject.
names
)

Create a SubjectAlternativeNameExtension with the passed GeneralNames.

public
SubjectAlternativeNameExtension(Boolean
true if the extension is to be treated as critical.
critical
,
GeneralNames
the GeneralNames for the subject, cannot be null or empty.
names
)

Create a SubjectAlternativeNameExtension with the specified criticality and GeneralNames.

public
SubjectAlternativeNameExtension(Boolean
true if the extension is to be treated as critical.
critical
,
Object
an array of DER encoded bytes of the actual value.
value
)

Create the extension from the passed DER encoded value.

Method Summary

Modifier and TypeMethod and Description
public void
encode(DerOutputStream
the DerOutputStream to write the extension to.
out
)

Overrides sun.security.x509.Extension.encode.

Implements sun.security.util.DerEncoder.encode.

Write the extension to the OutputStream.

private void
public String
getName()

Overrides sun.security.x509.Extension.getName.

Return the name of this extension.

public GeneralNames
getNames()

Get the GeneralNames value.

public String
toString()

Overrides sun.security.x509.Extension.toString.

Returns a printable representation of the SubjectAlternativeName.

Inherited from sun.security.x509.Extension:
encodeequalsgetExtensionIdgetExtensionValuegetIdgetValuehashCodeisCriticalnewExtension

Field Detail

NAMEback to summary
public static final String NAME
namesback to summary
pack-priv GeneralNames names

Constructor Detail

SubjectAlternativeNameExtensionback to summary
public SubjectAlternativeNameExtension(GeneralNames names)

Create a SubjectAlternativeNameExtension with the passed GeneralNames. The extension is marked non-critical.

Parameters
names:GeneralNames

the GeneralNames for the subject.

SubjectAlternativeNameExtensionback to summary
public SubjectAlternativeNameExtension(Boolean critical, GeneralNames names)

Create a SubjectAlternativeNameExtension with the specified criticality and GeneralNames.

Parameters
critical:Boolean

true if the extension is to be treated as critical.

names:GeneralNames

the GeneralNames for the subject, cannot be null or empty.

SubjectAlternativeNameExtensionback to summary
public SubjectAlternativeNameExtension(Boolean critical, Object value) throws IOException

Create the extension from the passed DER encoded value.

Parameters
critical:Boolean

true if the extension is to be treated as critical.

value:Object

an array of DER encoded bytes of the actual value.

Exceptions
IOException:
on error.
ClassCastException:
if value is not an array of bytes

Method Detail

encodeback to summary
public void encode(DerOutputStream out)

Overrides sun.security.x509.Extension.encode.

Implements sun.security.util.DerEncoder.encode.

Write the extension to the OutputStream.

Parameters
out:DerOutputStream

the DerOutputStream to write the extension to.

Annotations
@Override
encodeThisback to summary
private void encodeThis()
getNameback to summary
public String getName()

Overrides sun.security.x509.Extension.getName.

Return the name of this extension.

Annotations
@Override
getNamesback to summary
public GeneralNames getNames()

Get the GeneralNames value.

toStringback to summary
public String toString()

Overrides sun.security.x509.Extension.toString.

Returns a printable representation of the SubjectAlternativeName.