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

public Class BasicConstraintsExtension

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

This class represents the Basic Constraints Extension.

The basic constraints extension identifies whether the subject of the certificate is a CA and how deep a certification path may exist through that CA.

The ASN.1 syntax for this extension is:
BasicConstraints ::= SEQUENCE {
    cA                BOOLEAN DEFAULT FALSE,
    pathLenConstraint INTEGER (0..MAX) OPTIONAL
}
Authors
Amit Kapoor, Hemma Prafullchandra
See Also
Extension

Field Summary

Modifier and TypeField and Description
private boolean
public static final String
private int
Inherited from sun.security.x509.Extension:
criticalextensionIdextensionValue

Constructor Summary

AccessConstructor and Description
public
BasicConstraintsExtension(boolean
true, if the subject of the Certificate is a CA.
ca
,
int
specifies the depth of the certification path.
len
)

Default constructor for this object.

public
BasicConstraintsExtension(Boolean
true, if the extension should be marked critical
critical
,
boolean
true, if the subject of the Certificate is a CA.
ca
,
int
specifies the depth of the certification path.
len
)

Constructor for this object with specified criticality.

public
BasicConstraintsExtension(Boolean
flag indicating if extension is critical or not
critical
,
Object
an array containing the DER encoded bytes of the extension.
value
)

Create the extension from the passed DER encoded value of the same.

Method Summary

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

Overrides sun.security.x509.Extension.encode.

Implements sun.security.util.DerEncoder.encode.

Encode this extension value to the output stream.

private void
public String
getName()

Overrides sun.security.x509.Extension.getName.

Return the name of this extension.

public int
public boolean
isCa()

public String
toString()

Overrides sun.security.x509.Extension.toString.

Return user readable form of extension.

Inherited from sun.security.x509.Extension:
encodeequalsgetExtensionIdgetExtensionValuegetIdgetValuehashCodeisCriticalnewExtension

Field Detail

caback to summary
private boolean ca
NAMEback to summary
public static final String NAME
pathLenback to summary
private int pathLen

Constructor Detail

BasicConstraintsExtensionback to summary
public BasicConstraintsExtension(boolean ca, int len)

Default constructor for this object. The extension is marked critical if the ca flag is true, false otherwise.

Parameters
ca:boolean

true, if the subject of the Certificate is a CA.

len:int

specifies the depth of the certification path.

BasicConstraintsExtensionback to summary
public BasicConstraintsExtension(Boolean critical, boolean ca, int len)

Constructor for this object with specified criticality.

Parameters
critical:Boolean

true, if the extension should be marked critical

ca:boolean

true, if the subject of the Certificate is a CA.

len:int

specifies the depth of the certification path.

BasicConstraintsExtensionback to summary
public BasicConstraintsExtension(Boolean critical, Object value) throws IOException

Create the extension from the passed DER encoded value of the same.

Parameters
critical:Boolean

flag indicating if extension is critical or not

value:Object

an array containing the DER encoded bytes of the extension.

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.

Encode this extension value to the output stream.

Parameters
out:DerOutputStream

the DerOutputStream to encode 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
getPathLenback to summary
public int getPathLen()
isCaback to summary
public boolean isCa()
toStringback to summary
public String toString()

Overrides sun.security.x509.Extension.toString.

Return user readable form of extension.