iaik.asn1.structures
Class PolicyInformation

java.lang.Object
  |
  +--iaik.asn1.structures.PolicyInformation

public class PolicyInformation
extends Object

This class implements the ASN.1 type PolicyInformation.

A sequence of policy information terms is used within a X.509v3 Certificate Policies extension for indicating the policy under which the certificate has been issued and the purposes for which the certificate may be used. Each of such policy information terms consists of an object identifier (OID) and optional qualifiers (see X.509 Certificate and CRL profile presented in RFC 2459):

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

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

CertPolicyId ::= OBJECT IDENTIFIER

PolicyQualifierInfo ::= SEQUENCE { policyQualifierId PolicyQualifierId, qualifier ANY DEFINED BY policyQualifierId }

The X.509 Certificate and CRL profile presented in RFC 2459 defines two policy qualifiers types:

 Qualifier ::= CHOICE {
    cPSuri         CPSuri,     -- CPS Pointer qualifier
    userNotice     UserNotice  -- User Notice qualifier
 }
 

The CPS Pointer qualifier indicates a (URI) pointer to a Certification Practice Statement (CPS) published by the CA:

CPSuri ::= IA5String

The User Notice qualifier may include a noticeRef field identifying an organization and a particular textual statement prepared by that organization, or/and an explicitText string field of up to 200 characters including the textual statement directly into the certificate:

 UserNotice ::= SEQUENCE {
   noticeRef     NoticeReference OPTIONAL,
   explicitText  DisplayText OPTIONAL}
 
NoticeReference ::= SEQUENCE { organization DisplayText, noticeNumbers SEQUENCE OF INTEGER }
DisplayText ::= CHOICE { visibleString VisibleString (SIZE (1..200)), bmpString BMPString (SIZE (1..200)), utf8String UTF8String (SIZE (1..200)) }

More information can be found in RFC 2459, section 4.2.1.5 "Certificate Policies".

When creating a PolicyInformation object to be used for the CertificatePolicies extension, specify the policyQualifierId as ObjectID and the policy qualifiers as array of PolicyQualifierInfo objects, e.g.:

 int[] notice_nr = {12, 35};
 ObjectID iaik_policy_id = new ObjectID("1.2.3.4.5", "iaik_policy_id");
 PolicyQualifierInfo[] policy_qualifier = new PolicyQualifierInfo[1];
 policy_qualifier[0] = new PolicyQualifierInfo("IAIK", notice_nr, null);
 PolicyInformation policy_info = new PolicyInformation(iaik_policy_id, policy_qualifier);
 

Version:
File Revision 15
See Also:
PolicyQualifierInfo, CertificatePolicies

Constructor Summary
PolicyInformation(ASN1Object policyInformation)
          Constructs a PolicyInformation from an ASN1Object.
PolicyInformation(ObjectID policyIdentifier, PolicyQualifierInfo[] policyQualifiers)
          Creates a new PolicyInformation object from given policy id and policy qualifiers.
 
Method Summary
 ObjectID getPolicyIdentifier()
          Returns the policy indentifier.
 PolicyQualifierInfo[] getPolicyQualifiers()
          Returns the policy qualifiers.
 ASN1Object toASN1Object()
          Returns this PolicyInformation as (SEQUENCE) ASN1Object.
 String toString()
          Returns a string that represents the contents of this PolicyInformation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PolicyInformation

public PolicyInformation(ObjectID policyIdentifier,
                         PolicyQualifierInfo[] policyQualifiers)
Creates a new PolicyInformation object from given policy id and policy qualifiers.
Parameters:
policyIdentifier - the id of the policy
policyQualifiers - zero ore more qualifiers (can be null)

PolicyInformation

public PolicyInformation(ASN1Object policyInformation)
                  throws CodingException
Constructs a PolicyInformation from an ASN1Object.

Parses the given ASN.1 PolicyInformation object for policy identifier and any included policy qualifiers.

Parameters:
policyInformation - the PolicyInformation as ASN1Object
Throws:
CodingException - if the ASN1Object is not a PolicyInformation
Method Detail

toASN1Object

public ASN1Object toASN1Object()
Returns this PolicyInformation as (SEQUENCE) ASN1Object.
Returns:
this PolicyInformation as ASN1Object

getPolicyIdentifier

public ObjectID getPolicyIdentifier()
Returns the policy indentifier.
Returns:
the policy indentifier

getPolicyQualifiers

public PolicyQualifierInfo[] getPolicyQualifiers()
Returns the policy qualifiers.
Returns:
the policy qualifiers

toString

public String toString()
Returns a string that represents the contents of this PolicyInformation.
Overrides:
toString in class Object
Returns:
the string representation

This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note).

IAIK-JCE 3.1 with IAIK-JCE CC Core 3.1, (c) 1997-2004 IAIK