public class

CertificatePoliciesExtension

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

Class Overview

This class defines the certificate policies extension which specifies the policies under which the certificate has been issued and the purposes for which the certificate may be used.

Applications with specific policy requirements are expected to have a list of those policies which they will accept and to compare the policy OIDs in the certificate to that list. If this extension is critical, the path validation software MUST be able to interpret this extension (including the optional qualifier), or MUST reject the certificate.

Optional qualifiers are not supported in this implementation, as they are not recommended by RFC2459. The ASN.1 syntax for this is (IMPLICIT tagging is defined in the module definition):

 id-ce-certificatePolicies OBJECT IDENTIFIER ::=  { id-ce 32 }

 certificatePolicies ::= SEQUENCE SIZE (1..MAX) OF PolicyInformation

 PolicyInformation ::= SEQUENCE {
      policyIdentifier   CertPolicyId,
      policyQualifiers   SEQUENCE SIZE (1..MAX) OF
                              PolicyQualifierInfo OPTIONAL }

 CertPolicyId ::= OBJECT IDENTIFIER
 

Summary

Constants
String IDENT Identifier for this attribute, to be used with the get, set, delete methods of Certificate, x509 type.
String NAME Attribute names.
String POLICIES
[Expand]
Inherited Fields
From class sun.security.x509.Extension
Public Constructors
CertificatePoliciesExtension(List<PolicyInformation> certPolicies)
Create a CertificatePoliciesExtension object from a List of PolicyInformation; the criticality is set to false.
CertificatePoliciesExtension(Boolean critical, List<PolicyInformation> certPolicies)
Create a CertificatePoliciesExtension object from a List of PolicyInformation with specified criticality.
CertificatePoliciesExtension(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.CertificatePolicies"

public static final String NAME

Attribute names.

Constant Value: "CertificatePolicies"

public static final String POLICIES

Constant Value: "policies"

Public Constructors

public CertificatePoliciesExtension (List<PolicyInformation> certPolicies)

Create a CertificatePoliciesExtension object from a List of PolicyInformation; the criticality is set to false.

Parameters
certPolicies the List of PolicyInformation.
Throws
IOException

public CertificatePoliciesExtension (Boolean critical, List<PolicyInformation> certPolicies)

Create a CertificatePoliciesExtension object from a List of PolicyInformation with specified criticality.

Parameters
critical true if the extension is to be treated as critical.
certPolicies the List of PolicyInformation.
Throws
IOException

public CertificatePoliciesExtension (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.