public class

BasicConstraintsExtension

extends Extension
implements CertAttrSet<T>
java.lang.Object
   ↳ sun.security.x509.Extension
     ↳ sun.security.x509.BasicConstraintsExtension

Class Overview

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
 }
 

Summary

Constants
String IDENT Identifier for this attribute, to be used with the get, set, delete methods of Certificate, x509 type.
String IS_CA
String NAME Attribute names.
String PATH_LEN
[Expand]
Inherited Fields
From class sun.security.x509.Extension
Public Constructors
BasicConstraintsExtension(boolean ca, int len)
Default constructor for this object.
BasicConstraintsExtension(Boolean critical, boolean ca, int len)
Constructor for this object with specified criticality.
BasicConstraintsExtension(Boolean critical, Object value)
Create the extension from the passed DER encoded value of the same.
Public Methods
void delete(String name)
Delete the attribute value.
void encode(OutputStream out)
Encode this extension value to the output stream.
Object get(String name)
Get the attribute value.
Enumeration<String> getElements()
Return an enumeration of names of attributes existing within this attribute.
String getName()
Return the name of this attribute.
void set(String name, Object obj)
Set the attribute value.
String toString()
Return user readable form of extension.
[Expand]
Inherited Methods
From class sun.security.x509.Extension
From class java.lang.Object
From interface sun.security.x509.CertAttrSet

Constants

public static final String IDENT

Identifier for this attribute, to be used with the get, set, delete methods of Certificate, x509 type.

Constant Value: "x509.info.extensions.BasicConstraints"

public static final String IS_CA

Constant Value: "is_ca"

public static final String NAME

Attribute names.

Constant Value: "BasicConstraints"

public static final String PATH_LEN

Constant Value: "path_len"

Public Constructors

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 true, if the subject of the Certificate is a CA.
len specifies the depth of the certification path.
Throws
IOException

public BasicConstraintsExtension (Boolean critical, boolean ca, int len)

Constructor for this object with specified criticality.

Parameters
critical true, if the extension should be marked critical
ca true, if the subject of the Certificate is a CA.
len specifies the depth of the certification path.
Throws
IOException

public BasicConstraintsExtension (Boolean critical, Object value)

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

Parameters
critical flag indicating if extension is critical or not
value an array containing the DER encoded bytes of the extension.
Throws
ClassCastException if value is not an array of bytes
IOException on error.

Public Methods

public void delete (String name)

Delete the attribute value.

Parameters
name the name of the attribute to delete.
Throws
IOException

public void encode (OutputStream out)

Encode this extension value to the output stream.

Parameters
out the DerOutputStream to encode the extension to.
Throws
IOException

public Object get (String name)

Get the attribute value.

Parameters
name the name of the attribute to return.
Throws
IOException

public Enumeration<String> getElements ()

Return an enumeration of names of attributes existing within this attribute.

Returns
  • an enumeration of the attribute names.

public String getName ()

Return the name of this attribute.

Returns
  • the name of this CertAttrSet.

public void set (String name, Object obj)

Set the attribute value.

Parameters
name the name of the attribute (e.g. "x509.info.key")
obj the attribute object.
Throws
IOException

public String toString ()

Return user readable form of extension.

Returns
  • a string representation of the object.