Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/java/security/cert/PolicyQualifierInfo#pubctors) \| [Methods](https://developer.android.com/reference/java/security/cert/PolicyQualifierInfo#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/java/security/cert/PolicyQualifierInfo#inhmethods)

# PolicyQualifierInfo

` public class PolicyQualifierInfo `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | java.security.cert.PolicyQualifierInfo |

<br />

*** ** * ** ***

An immutable 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 }
```

A certificate policies extension, if present in an X.509 version 3 certificate, contains a sequence of one or more policy information terms, each of which consists of an object identifier (OID) and optional qualifiers. In an end-entity certificate, these policy information terms 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 policy information terms limit the set of policies for certification paths which include this certificate.

A `Set` of `PolicyQualifierInfo` objects are returned by the `https://developer.android.com/reference/java/security/cert/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 `https://developer.android.com/reference/java/security/cert/PKIXParameters#setPolicyQualifiersRejected(boolean)` 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.

**Concurrent Access**

All `PolicyQualifierInfo` objects must be immutable and thread-safe. That is, multiple threads may concurrently invoke the methods defined in this class on a single `PolicyQualifierInfo` object (or more than one) with no ill effects. Requiring `PolicyQualifierInfo` objects to be immutable and thread-safe allows them to be passed around to various pieces of code without worrying about coordinating access.

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/java/security/cert/PolicyQualifierInfo#PolicyQualifierInfo(byte[])(byte[] encoded) ` Creates an instance of `PolicyQualifierInfo` from the encoded bytes. |

| ### Public methods ||
|---|---|
| ` final byte[]` | ` https://developer.android.com/reference/java/security/cert/PolicyQualifierInfo#getEncoded()() ` Returns the ASN.1 DER encoded form of this `PolicyQualifierInfo`. |
| ` final byte[]` | ` https://developer.android.com/reference/java/security/cert/PolicyQualifierInfo#getPolicyQualifier()() ` Returns the ASN.1 DER encoded form of the `qualifier` field of this `PolicyQualifierInfo`. |
| ` final https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/security/cert/PolicyQualifierInfo#getPolicyQualifierId()() ` Returns the `policyQualifierId` field of this `PolicyQualifierInfo`. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/security/cert/PolicyQualifierInfo#toString()() ` Return a printable representation of this `PolicyQualifierInfo`. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Public constructors

### PolicyQualifierInfo

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public PolicyQualifierInfo (byte[] encoded)
```

Creates an instance of `PolicyQualifierInfo` from the encoded bytes. The encoded byte array is copied on construction.

<br />

| Parameters ||
|---|---|
| `encoded` | `byte`: a byte array containing the qualifier in DER encoding <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/io/IOException` | thrown if the byte array does not represent a valid and parsable policy qualifier |

## Public methods

### getEncoded

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final byte[] getEncoded ()
```

Returns the ASN.1 DER encoded form of this `PolicyQualifierInfo`.

<br />

| Returns ||
|---|---|
| `byte[]` | the ASN.1 DER encoded bytes (never `null`). Note that a copy is returned, so the data is cloned each time this method is called. <br /> |

### getPolicyQualifier

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final byte[] getPolicyQualifier ()
```

Returns the ASN.1 DER encoded form of the `qualifier` field of this `PolicyQualifierInfo`.

<br />

| Returns ||
|---|---|
| `byte[]` | the ASN.1 DER encoded bytes of the `qualifier` field. Note that a copy is returned, so the data is cloned each time this method is called. <br /> |

### getPolicyQualifierId

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final String getPolicyQualifierId ()
```

Returns the `policyQualifierId` field of this `PolicyQualifierInfo`. The `policyQualifierId` is an Object Identifier (OID) represented by a set of nonnegative integers separated by periods.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the OID (never `null`) <br /> |

### toString

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String toString ()
```

Return a printable representation of this `PolicyQualifierInfo`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | a `String` describing the contents of this `PolicyQualifierInfo` <br /> |