public class

PolicyConstraintsExtension

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

Class Overview

This class defines the certificate extension which specifies the Policy constraints.

The policy constraints extension can be used in certificates issued to CAs. The policy constraints extension constrains path validation in two ways. It can be used to prohibit policy mapping or require that each certificate in a path contain an acceptable policy identifier.

The ASN.1 syntax for this is (IMPLICIT tagging is defined in the module definition):

 PolicyConstraints ::= SEQUENCE {
     requireExplicitPolicy [0] SkipCerts OPTIONAL,
     inhibitPolicyMapping  [1] SkipCerts OPTIONAL
 }
 SkipCerts ::= INTEGER (0..MAX)
 

Summary

Constants
String IDENT Identifier for this attribute, to be used with the get, set, delete methods of Certificate, x509 type.
String INHIBIT
String NAME Attribute names.
String REQUIRE
[Expand]
Inherited Fields
From class sun.security.x509.Extension
Public Constructors
PolicyConstraintsExtension(int require, int inhibit)
Create a PolicyConstraintsExtension object with both require explicit policy and inhibit policy mapping.
PolicyConstraintsExtension(Boolean critical, int require, int inhibit)
Create a PolicyConstraintsExtension object with specified criticality and both require explicit policy and inhibit policy mapping.
PolicyConstraintsExtension(Boolean critical, Object value)
Create the extension from its DER encoded value and criticality.
Public Methods
void delete(String name)
Delete the attribute value.
void encode(OutputStream out)
Write the extension to the DerOutputStream.
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 the extension as user readable string.
[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.PolicyConstraints"

public static final String INHIBIT

Constant Value: "inhibit"

public static final String NAME

Attribute names.

Constant Value: "PolicyConstraints"

public static final String REQUIRE

Constant Value: "require"

Public Constructors

public PolicyConstraintsExtension (int require, int inhibit)

Create a PolicyConstraintsExtension object with both require explicit policy and inhibit policy mapping. The extension is marked non-critical.

Parameters
require require explicit policy (-1 for optional).
inhibit inhibit policy mapping (-1 for optional).
Throws
IOException

public PolicyConstraintsExtension (Boolean critical, int require, int inhibit)

Create a PolicyConstraintsExtension object with specified criticality and both require explicit policy and inhibit policy mapping.

Parameters
critical true if the extension is to be treated as critical.
require require explicit policy (-1 for optional).
inhibit inhibit policy mapping (-1 for optional).
Throws
IOException

public PolicyConstraintsExtension (Boolean critical, Object value)

Create the extension from its DER encoded value and criticality.

Parameters
critical true if the extension is to be treated as critical.
value an array of DER encoded bytes of the actual value.
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)

Write the extension to the DerOutputStream.

Parameters
out the DerOutputStream to write the extension to.
Throws
IOException on encoding errors.

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 the extension as user readable string.

Returns
  • a string representation of the object.