FileDocCategorySizeDatePackage
PolicyQualifierInfo.javaAPI DocAndroid 1.5 API4436Wed May 06 22:41:06 BST 2009java.security.cert

PolicyQualifierInfo

public class PolicyQualifierInfo extends Object
This class implements a policy qualifier as defined by the ASN.1 {@code PolicyQualifierInfo} structure.
since
Android 1.0

Fields Summary
private final byte[]
encoded
private final String
policyQualifierId
private final byte[]
policyQualifier
Constructors Summary
public PolicyQualifierInfo(byte[] encoded)
Creates a new {@code PolicyQualifierInfo} from the specified encoded form.

param
encoded the DER encoded policy qualifier.
throws
IOException the policy qualifier cannot be decoded.
since
Android 1.0

        if (encoded == null) {
            throw new NullPointerException(Messages.getString("security.0A")); //$NON-NLS-1$
        }
        if (encoded.length == 0) {
            throw new IOException(Messages.getString("security.69")); //$NON-NLS-1$
        }
        this.encoded = new byte[encoded.length];
        System.arraycopy(encoded, 0, this.encoded, 0, this.encoded.length);
        
        // DER Decoding:
        Object[] decoded = (Object[]) org.apache.harmony.security.x509.PolicyQualifierInfo.ASN1
                .decode(this.encoded);
        policyQualifierId = ObjectIdentifier.toString((int[]) decoded[0]);
        policyQualifier = (byte[]) decoded[1];
    
Methods Summary
public final byte[]getEncoded()
Returns a ASN.1 DER encoded copy of policy qualifier info.

return
a ASN.1 DER encoded copy of policy qualifier info.
since
Android 1.0

        byte[] ret = new byte[encoded.length];
        System.arraycopy(encoded, 0, ret, 0, encoded.length);
        return ret;
    
public final byte[]getPolicyQualifier()
Returns a ASN.1 DER encoded copy of the qualifier of this policy qualifier info.

return
a ASN.1 DER encoded copy of the qualifier of this policy qualifier info.
since
Android 1.0

        if (policyQualifier == null) {
            return null;
        }
        byte[] ret = new byte[policyQualifier.length];
        System.arraycopy(policyQualifier, 0, ret, 0, policyQualifier.length);
        return ret;
    
public final java.lang.StringgetPolicyQualifierId()
Returns the identifier (an OID) of this policy qualifier info.

return
the identifier of this policy qualifier info.
since
Android 1.0

        return policyQualifierId;
    
public java.lang.StringtoString()
Returns a string representation of this {@code PolicyQualifierInfo} instance.

return
a string representation of this {@code PolicyQualifierInfo} instance.
since
Android 1.0

        StringBuffer sb =
            new StringBuffer("PolicyQualifierInfo: [\npolicyQualifierId: "); //$NON-NLS-1$
        sb.append(policyQualifierId);
        sb.append("\npolicyQualifier: \n"); //$NON-NLS-1$
        sb.append(Array.toString(policyQualifier, " ")); //$NON-NLS-1$
        sb.append("]"); //$NON-NLS-1$
        return sb.toString();