PolicyQualifierInfopublic class PolicyQualifierInfo extends Object This class implements a policy qualifier as defined by the ASN.1
{@code PolicyQualifierInfo} structure. |
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.
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.
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.
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.String | getPolicyQualifierId()Returns the identifier (an OID) of this policy qualifier info.
return policyQualifierId;
| public java.lang.String | toString()Returns a string representation of this {@code PolicyQualifierInfo}
instance.
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();
|
|