FileDocCategorySizeDatePackage
PolicyConstraints.javaAPI DocAndroid 1.5 API6218Wed May 06 22:41:06 BST 2009org.apache.harmony.security.x509

PolicyConstraints

public class PolicyConstraints extends ExtensionValue
The class encapsulates the ASN.1 DER encoding/decoding work with PolicyConstraints structure which is a part of X.509 certificate (as specified in RFC 3280 - Internet X.509 Public Key Infrastructure. Certificate and Certificate Revocation List (CRL) Profile. http://www.ietf.org/rfc/rfc3280.txt):

PolicyConstraints ::= SEQUENCE {
requireExplicitPolicy [0] SkipCerts OPTIONAL,
inhibitPolicyMapping [1] SkipCerts OPTIONAL }

SkipCerts ::= INTEGER (0..MAX)

TODO: This class is not fully implemented.
see
org.apache.harmony.security.x509.GeneralSubtree
see
org.apache.harmony.security.x509.GeneralName

Fields Summary
private final BigInteger
requireExplicitPolicy
private final BigInteger
inhibitPolicyMapping
private byte[]
encoding
public static final org.apache.harmony.security.asn1.ASN1Sequence
ASN1
X.509 PolicyConstraints encoder/decoder.
Constructors Summary
public PolicyConstraints()
TODO

        this(null, null);
    
public PolicyConstraints(BigInteger requireExplicitPolicy, BigInteger inhibitPolicyMapping)
TODO

param
requireExplicitPolicy: GeneralSubtrees
param
inhibitPolicyMapping: GeneralSubtrees

        this.requireExplicitPolicy = requireExplicitPolicy;
        this.inhibitPolicyMapping = inhibitPolicyMapping;
    
public PolicyConstraints(int requireExplicitPolicy, int inhibitPolicyMapping)
TODO

param
requireExplicitPolicy: GeneralSubtrees
param
inhibitPolicyMapping: GeneralSubtrees

        this.requireExplicitPolicy = BigInteger.valueOf(requireExplicitPolicy);
        this.inhibitPolicyMapping = BigInteger.valueOf(inhibitPolicyMapping);
    
public PolicyConstraints(byte[] encoding)

        super(encoding);
        PolicyConstraints pc = (PolicyConstraints) ASN1.decode(encoding);
        this.requireExplicitPolicy = pc.requireExplicitPolicy;
        this.inhibitPolicyMapping = pc.inhibitPolicyMapping;
    
private PolicyConstraints(BigInteger requireExplicitPolicy, BigInteger inhibitPolicyMapping, byte[] encoding)

        this(requireExplicitPolicy, inhibitPolicyMapping);
        this.encoding = encoding;
    
Methods Summary
public voiddumpValue(java.lang.StringBuffer buffer, java.lang.String prefix)
Places the string representation of extension value into the StringBuffer object.

        buffer.append(prefix).append("PolicyConstraints: [\n"); //$NON-NLS-1$
        if (requireExplicitPolicy != null) {
            buffer.append(prefix).append("  requireExplicitPolicy: ") //$NON-NLS-1$
                .append(requireExplicitPolicy).append('\n");
        }
        if (inhibitPolicyMapping != null) {
            buffer.append(prefix).append("  inhibitPolicyMapping: ") //$NON-NLS-1$
                .append(inhibitPolicyMapping).append('\n");
        }
        buffer.append(prefix).append("]\n"); //$NON-NLS-1$
    
public byte[]getEncoded()
Returns ASN.1 encoded form of this X.509 PolicyConstraints value.

return
a byte array containing ASN.1 encode form.

        if (encoding == null) {
            encoding = ASN1.encode(this);
        }
        return encoding;