public class PolicyInformation
extends java.lang.Object
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 3280):
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 3280 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 3280, 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);
PolicyQualifierInfo
,
CertificatePolicies
Constructor and Description |
---|
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. |
Modifier and Type | Method and Description |
---|---|
ObjectID |
getPolicyIdentifier()
Returns the policy indentifier.
|
PolicyQualifierInfo[] |
getPolicyQualifiers()
Returns the policy qualifiers.
|
ASN1Object |
toASN1Object()
Returns this
PolicyInformation as (SEQUENCE) ASN1Object. |
java.lang.String |
toString()
Returns a string that represents the contents of this
PolicyInformation . |
public PolicyInformation(ObjectID policyIdentifier, PolicyQualifierInfo[] policyQualifiers)
PolicyInformation
object from given policy id
and policy qualifiers.policyIdentifier
- the id of the policypolicyQualifiers
- zero ore more qualifiers (can be null
)public PolicyInformation(ASN1Object policyInformation) throws CodingException
PolicyInformation
from an ASN1Object.
Parses the given ASN.1 PolicyInformation
object for policy
identifier and any included policy qualifiers.
policyInformation
- the PolicyInformation
as ASN1ObjectCodingException
- if the ASN1Object is not a PolicyInformation
public ASN1Object toASN1Object()
PolicyInformation
as (SEQUENCE) ASN1Object.public ObjectID getPolicyIdentifier()
public PolicyQualifierInfo[] getPolicyQualifiers()
public java.lang.String toString()
PolicyInformation
.toString
in class java.lang.Object