public class PolicyQualifierInfo
extends java.lang.Object
PolicyQualifierInfo
.
The PolicyQualifierInfo
type is used for defining the
information specified by the PolicyInformation
terms of the
X.509v3 Certificate Policies extension, indicating the policy under
which the certificate has been issued and the purposes for which the
certificate may be used.
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 PKIX X.509 Certificate and CRL profile (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 { ia5String IA5String (SIZE (1..200)), visibleString VisibleString (SIZE (1..200)), bmpString BMPString (SIZE (1..200)), utf8String UTF8String (SIZE (1..200)) }
The policy qualifier IDs for the CPS Pointer and User Notice qualifiers are defined as follows:
id-qt ::= { id-pkix 2 } -- pkix arc for qualifier types
id-qt-cps OBJECT IDENTIFIER ::= { id-qt 1 } id-qt-unotice OBJECT IDENTIFIER ::= { id-qt 2 }
PolicyQualifierId ::= OBJECT IDENTIFIER ( id-qt-cps | id-qt-unotice )
More information can be found in the PKIX internet draft draft-ietf-pkix-ipki-part1-06.txt, section 4.2.1.5 "Certificate Policies".
When creating a PolicyQualifierInfo
object to be set for a
PolicyInformation
, use a
proper constructor for either specifying a
CPS Pointer
qualifier or a
User Notice
qualifier,
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("IAIK", notice_nr, null);
PolicyInformation
,
CertificatePolicies
Constructor and Description |
---|
PolicyQualifierInfo(ASN1Object policyQualifierInfo)
Constructs a
PolicyQualifierInfo from an ASN1Object. |
PolicyQualifierInfo(ASN1Object organization,
int[] noticeNumbers,
ASN1Object explicitText)
Creates a new
PolicyQualifierInfo from a user notice qualifier
specified by reference information and/or an explicit text. |
PolicyQualifierInfo(java.lang.String CpsUri)
Creates a new
PolicyQualifierInfo from a CPS Pointer
qualifier. |
PolicyQualifierInfo(java.lang.String organization,
int[] noticeNumbers,
java.lang.String explicitText)
Creates a new
PolicyQualifierInfo from a user notice qualifier
specified by reference information and/or an explicit text. |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getCPSuri()
Gets the CPSUri or
null if this PolicyQualifierInfo is not a
CPS Pointer. |
ASN1Object |
getExplicitTest()
Deprecated.
only for compability to former versions, please use
getExplicitText |
ASN1Object |
getExplicitText()
Gets the explicitText value if this PolicyQualifierInfo is a User Notice
Qualifier and the explicitText field is set.
|
int[] |
getNoticeNumbers()
Gets the notice numbers if this PolicyQualifierInfo is a User Notice
Qualifier and notice numbers are set.
|
ASN1Object |
getOrganization()
Gets the organization value if this PolicyQualifierInfo is a User Notice
Qualifier and the orgnization field is set.
|
ObjectID |
getPolicyQualifier()
Gets the ID of this PolicyQualifierInfo.
|
ASN1Object |
getQualifierValue()
Gets the value (of the qualifier field) of this PolicyQualifierInfo.
|
ASN1Object |
toASN1Object()
Returns this
PolicyQualifierInfo as ASN1Object. |
java.lang.String |
toString()
Returns a string that represents the contents of
PolicyQualifierInfo |
public PolicyQualifierInfo(java.lang.String CpsUri)
PolicyQualifierInfo
from a CPS Pointer
qualifier.
The CPS Pointer qualifier contains a pointer to a Certification
Practice Statement (CPS) published by the CA. The pointer is in the form of
an URI.CpsUri
- the pointer as URIpublic PolicyQualifierInfo(java.lang.String organization, int[] noticeNumbers, java.lang.String explicitText)
PolicyQualifierInfo
from a user notice qualifier
specified by reference information and/or an explicit text.
A user notice qualifier has two optional fields:
UserNotice ::= SEQUENCE { noticeRef NoticeReference OPTIONAL, explicitText DisplayText OPTIONAL}
A notice reference consists of an organization name and a notice number identifying a particular textual statement prepared by this organization:
NoticeReference ::= SEQUENCE { organization DisplayText, noticeNumbers SEQUENCE OF INTEGER }
An explicitText field includes the textual statement directly in the certificate. The explicitText field is a string with a maximum size of 200 characters:
DisplayText ::= CHOICE { ia5String IA5String (SIZE (1..200)), visibleString VisibleString (SIZE (1..200)), bmpString BMPString (SIZE (1..200)), utf8String UTF8String (SIZE (1..200)) }
According RFC 5280 By default organization
and
explicitText
are encoded as UTF8String.
organization
- the organization [or null
if not needed; sets
noticeNumbers also to null
]noticeNumbers
- notice numbers [or null
if not needed; sets
organization also to null
]explicitText
- the textual statement or null
if not neededjava.lang.IllegalArgumentException
- if explicitText is present but too long (more than 200 characters)public PolicyQualifierInfo(ASN1Object organization, int[] noticeNumbers, ASN1Object explicitText)
PolicyQualifierInfo
from a user notice qualifier
specified by reference information and/or an explicit text.
A user notice qualifier has two optional fields:
UserNotice ::= SEQUENCE { noticeRef NoticeReference OPTIONAL, explicitText DisplayText OPTIONAL}
A notice reference consists of an organization name and a notice number identifying a particular textual statement prepared by this organization:
NoticeReference ::= SEQUENCE { organization DisplayText, noticeNumbers SEQUENCE OF INTEGER }
An explicitText field includes the textual statement directly in the certificate. The explicitText field is a string with a maximum size of 200 characters:
DisplayText ::= CHOICE { ia5String IA5String (SIZE (1..200)), visibleString VisibleString (SIZE (1..200)), bmpString BMPString (SIZE (1..200)), utf8String UTF8String (SIZE (1..200)) }
This constructor may be used when taking another encoding type than
IA5String for organization
and/or VisibleString for
explicitText
.
organization
- the organization [or null
if not needed; sets
noticeNumbers also to null
];noticeNumbers
- notice numbers [or null
if not needed; sets
organization also to null
]explicitText
- the textual statement or null
if not needed;public PolicyQualifierInfo(ASN1Object policyQualifierInfo) throws CodingException
PolicyQualifierInfo
from an ASN1Object.
The supplied ASN1Object represents an already existing PolicyQualifierInfo
that may have been created by means of the toASN1Object()
method.
policyQualifierInfo
- the PolicyQualifierInfo
as ASN1ObjectCodingException
- if the ASN1Object is not a PolicyQualifierInfopublic ObjectID getPolicyQualifier()
public ASN1Object getQualifierValue()
public java.lang.String getCPSuri()
null
if this PolicyQualifierInfo is not a
CPS Pointer.null
public ASN1Object getOrganization()
null
public ASN1Object getExplicitTest()
getExplicitText
null
public ASN1Object getExplicitText()
null
public int[] getNoticeNumbers()
null
public ASN1Object toASN1Object()
PolicyQualifierInfo
as ASN1Object.public java.lang.String toString()
PolicyQualifierInfo
toString
in class java.lang.Object