Top Description Fields Constructors Methods
sun.security.x509

public Class CertificatePoliciesExtension

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

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 RFC 5280. 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
Author
Anne Anderson
Since
1.4
See Also
Extension

Field Summary

Modifier and TypeField and Description
private List<PolicyInformation>
certPolicies

List of PolicyInformation for this object.

public static final String
Inherited from sun.security.x509.Extension:
criticalextensionIdextensionValue

Constructor Summary

AccessConstructor and Description
public
CertificatePoliciesExtension(List<PolicyInformation>
the List of PolicyInformation.
certPolicies
)

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

public
CertificatePoliciesExtension(Boolean
true if the extension is to be treated as critical.
critical
,
List<PolicyInformation>
the List of PolicyInformation, cannot be null or empty.
certPolicies
)

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

public
CertificatePoliciesExtension(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 its DER encoded value and criticality.

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 DerOutputStream.
private void
public List<PolicyInformation>
getCertPolicies()

Get the PolicyInformation value.

public String
getName()

Overrides sun.security.x509.Extension.getName.

Return the name of this extension.
public String
toString()

Overrides sun.security.x509.Extension.toString.

Return the extension as user readable string.
Inherited from sun.security.x509.Extension:
encodeequalsgetExtensionIdgetExtensionValuegetIdgetValuehashCodeisCriticalnewExtension

Field Detail

certPoliciesback to summary
private List<PolicyInformation> certPolicies

List of PolicyInformation for this object.

NAMEback to summary
public static final String NAME

Constructor Detail

CertificatePoliciesExtensionback to summary
public CertificatePoliciesExtension(List<PolicyInformation> certPolicies)

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

Parameters
certPolicies:List<PolicyInformation>

the List of PolicyInformation.

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

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

Parameters
critical:Boolean

true if the extension is to be treated as critical.

certPolicies:List<PolicyInformation>

the List of PolicyInformation, cannot be null or empty.

CertificatePoliciesExtensionback to summary
public CertificatePoliciesExtension(Boolean critical, Object value) throws IOException

Create the extension from its DER encoded value and criticality.

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 DerOutputStream.

Parameters
out:DerOutputStream

the DerOutputStream to write the extension to.

Annotations
@Override
encodeThisback to summary
private void encodeThis()
getCertPoliciesback to summary
public List<PolicyInformation> getCertPolicies()

Get the PolicyInformation value.

getNameback to summary
public String getName()

Overrides sun.security.x509.Extension.getName.

Return the name of this extension.

Annotations
@Override
toStringback to summary
public String toString()

Overrides sun.security.x509.Extension.toString.

Return the extension as user readable string.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object