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

ReasonCode

public class ReasonCode extends ExtensionValue
CRL Entry's Reason Code Extension (OID = 2.5.29.21).
id-ce-cRLReason OBJECT IDENTIFIER ::= { id-ce 21 }

-- reasonCode ::= { CRLReason }
CRLReason ::= ENUMERATED {
unspecified (0),
keyCompromise (1),
cACompromise (2),
affiliationChanged (3),
superseded (4),
cessationOfOperation (5),
certificateHold (6),
removeFromCRL (8),
privilegeWithdrawn (9),
aACompromise (10)
}
(as specified in RFC 3280 http://www.ietf.org/rfc/rfc3280.txt)

Fields Summary
public static final byte
UNSPECIFIED
public static final byte
KEY_COMPROMISE
public static final byte
CA_COMPROMISE
public static final byte
AFFILIATION_CHANGED
public static final byte
SUPERSEDED
public static final byte
CESSATION_OF_OPERATION
public static final byte
CERTIFICATE_HOLD
public static final byte
REMOVE_FROM_CRL
public static final byte
PRIVILEGE_WITHDRAWN
public static final byte
AA_COMPROMISE
private final byte
code
public static org.apache.harmony.security.asn1.ASN1Type
ASN1
ASN.1 Encoder/Decoder.
Constructors Summary
public ReasonCode(byte code)


       
        this.code = code;
    
public ReasonCode(byte[] encoding)

        super(encoding);
        this.code = ((byte[]) ASN1.decode(encoding))[0];
    
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("Reason Code: [ "); //$NON-NLS-1$
        switch (code) {
            case UNSPECIFIED:
                buffer.append("unspecified"); //$NON-NLS-1$
                break;
            case KEY_COMPROMISE:
                buffer.append("keyCompromise"); //$NON-NLS-1$
                break;
            case CA_COMPROMISE:
                buffer.append("cACompromise"); //$NON-NLS-1$
                break;
            case AFFILIATION_CHANGED:
                buffer.append("affiliationChanged"); //$NON-NLS-1$
                break;
            case SUPERSEDED:
                buffer.append("superseded"); //$NON-NLS-1$
                break;
            case CESSATION_OF_OPERATION:
                buffer.append("cessationOfOperation"); //$NON-NLS-1$
                break;
            case CERTIFICATE_HOLD:
                buffer.append("certificateHold"); //$NON-NLS-1$
                break;
            case REMOVE_FROM_CRL:
                buffer.append("removeFromCRL"); //$NON-NLS-1$
                break;
            case PRIVILEGE_WITHDRAWN:
                buffer.append("privilegeWithdrawn"); //$NON-NLS-1$
                break;
            case AA_COMPROMISE:
                buffer.append("aACompromise"); //$NON-NLS-1$
                break;
        }
        buffer.append(" ]\n"); //$NON-NLS-1$
    
public intgetCode()

        return code;
    
public byte[]getEncoded()
Returns ASN.1 encoded form of this X.509 ReasonCode value.

return
a byte array containing ASN.1 encode form.

        if (encoding == null) {
            encoding = ASN1.encode(new byte[] {(byte) code});
        }
        return encoding;