java.security.cert
Class PolicyQualifierInfo

java.lang.Object
  |
  +--java.security.cert.PolicyQualifierInfo
All Implemented Interfaces:
Cloneable

public class PolicyQualifierInfo
extends Object
implements Cloneable

A policy qualifier represented by the ASN.1 PolicyQualifierInfo structure.

The ASN.1 definition is as follows:

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

The certificate policies extension in a certificate contains one or more encoded PolicyQualifierInfo structures, each of which consists of an object identifier (OID) and optional qualifiers. In an end-entity certificate, these qualifiers indicate the policy under which the certificate has been issued and the purposes for which the certificate may be used. In a CA certificate, these qualifiers limit the set of policies for certification paths which include this certificate.

Instances of this class are returned as elements of the Set of policy qualifiers returned by the PolicyNode.getPolicyQualifiers method. This allows applications with specific policy requirements to process and validate each policy qualifier. Applications that need to process policy qualifiers should explicitly set the policyQualifiersRejected flag to false (by calling the PKIXParameters.setPolicyQualifiersRejected method) before validating a certification path.

Note that the PKIX certification path validation algorithm specifies that any policy qualifier in a certificate policies extension that is marked critical must be processed and validated. Otherwise the certification path must be rejected. If the policyQualifiersRejected flag is set to false, it is up to the application to validate all policy qualifiers in this manner in order to be PKIX compliant.

Since:
1.4

Constructor Summary
PolicyQualifierInfo(byte[] encoded)
          Creates an instance of PolicyQualifierInfo from the encoded bytes.
 
Method Summary
 Object clone()
          Returns a copy of this object.
 boolean equals(Object other)
          Compares this object for equality with the specified object.
 byte[] getEncoded()
          Returns the ASN.1 DER encoded form of this PolicyQualifierInfo.
 byte[] getPolicyQualifier()
          Returns the ASN.1 DER encoded form of the qualifier component of the PolicyQualifierInfo.
 String getPolicyQualifierId()
          Returns the policyQualifier Object Identifier as a String.
 int hashCode()
          Returns a hash code value for this object.
 String toString()
          Return a printable representation of the PolicyQualifierInfo.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PolicyQualifierInfo

public PolicyQualifierInfo(byte[] encoded)
                    throws IOException
Creates an instance of PolicyQualifierInfo from the encoded bytes. The encoded byte array is copied on construction.
Parameters:
encoded - a byte array containing the qualifier in DER encoding
Throws:
IOException - thrown if the byte array does not represent a valid and parsable policy qualifier
Method Detail

getPolicyQualifierId

public String getPolicyQualifierId()
Returns the policyQualifier Object Identifier as a String.
Returns:
the OID (never null)

getEncoded

public byte[] getEncoded()
Returns the ASN.1 DER encoded form of this PolicyQualifierInfo.
Returns:
the object in a DER encoded byte array (never null). Note that a copy is returned, so the data is cloned each time this method is called.

getPolicyQualifier

public byte[] getPolicyQualifier()
Returns the ASN.1 DER encoded form of the qualifier component of the PolicyQualifierInfo.
Returns:
the data part of the object in a DER encoded byte array. Note that a copy is returned, so the data is cloned each time this method is called.

hashCode

public int hashCode()
Returns a hash code value for this object.
Overrides:
hashCode in class Object
Returns:
a hash code value

equals

public boolean equals(Object other)
Compares this object for equality with the specified object. If the other object is not an PolicyQualifierInfo, return false. Otherwise, return true if the parameters of the objects are equal.
Overrides:
equals in class Object
Parameters:
other - the object to test for equality
Returns:
true if the objects are equal, false otherwise

clone

public Object clone()
Returns a copy of this object.
Overrides:
clone in class Object
Returns:
the copy

toString

public String toString()
Return a printable representation of the PolicyQualifierInfo.
Overrides:
toString in class Object
Returns:
a String describing the contents of the PolicyQualifierInfo


Submit comments/suggestions about this API.
Copyright 1998-2000 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.