com.ibm.security12.sun.security.x509
Class CRLReasonCodeExtension

java.lang.Object
  |
  +--com.ibm.security12.sun.security.x509.Extension
        |
        +--com.ibm.security12.sun.security.x509.CRLReasonCodeExtension

public class CRLReasonCodeExtension
extends Extension
implements CertAttrSet

The reasonCode is a non-critical CRL entry extension that identifies the reason for the certificate revocation. CAs are strongly encouraged to include reason codes in CRL entries; however, the reason code CRL entry extension should be absent instead of using the unspecified (0) reasonCode value.

The ASN.1 syntax for this is:

  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) }
 

Version:
1.5
Author:
Hemma Prafullchandra
See Also:
Extension, CertAttrSet

Field Summary
static int AFFLIATION_CHANGED
           
static int CA_COMPROMISE
           
static int CERTIFICATE_HOLD
           
static int CESSATION_OF_OPERATION
           
static int KEY_COMPROMISE
           
static String NAME
          Attribute name and Reason codes
static String REASON
           
static int REMOVE_FROM_CRL
           
static int SUPERSEDED
           
static int UNSPECIFIED
           
 
Fields inherited from class com.ibm.security12.sun.security.x509.Extension
critical, extensionId, extensionValue
 
Constructor Summary
CRLReasonCodeExtension(boolean critical, int reason)
          Create a CRLReasonCodeExtension with the passed in reason.
CRLReasonCodeExtension(Boolean critical, Object value)
          Create the extension from the passed DER encoded value of the same.
CRLReasonCodeExtension(int reason)
          Create a CRLReasonCodeExtension with the passed in reason.
 
Method Summary
 void decode(InputStream in)
          Decode the extension from the InputStream - not just the value but the OID, criticality and the extension value.
 void delete(String name)
          Delete the attribute value.
 void encode(OutputStream out)
          Write the extension to the DerOutputStream.
 Object get(String name)
          Get the attribute value.
 Enumeration getElements()
          Return an enumeration of names of attributes existing within this attribute.
 String getName()
          Return the name of this attribute.
 void set(String name, Object obj)
          Set the attribute value.
 String toString()
          Returns a printable representation of the Reason code.
 
Methods inherited from class com.ibm.security12.sun.security.x509.Extension
encode, equals, getExtensionId, getExtensionValue, hashCode, isCritical
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NAME

public static final String NAME
Attribute name and Reason codes

REASON

public static final String REASON

UNSPECIFIED

public static final int UNSPECIFIED

KEY_COMPROMISE

public static final int KEY_COMPROMISE

CA_COMPROMISE

public static final int CA_COMPROMISE

AFFLIATION_CHANGED

public static final int AFFLIATION_CHANGED

SUPERSEDED

public static final int SUPERSEDED

CESSATION_OF_OPERATION

public static final int CESSATION_OF_OPERATION

CERTIFICATE_HOLD

public static final int CERTIFICATE_HOLD

REMOVE_FROM_CRL

public static final int REMOVE_FROM_CRL
Constructor Detail

CRLReasonCodeExtension

public CRLReasonCodeExtension(int reason)
                       throws IOException
Create a CRLReasonCodeExtension with the passed in reason. Criticality automatically set to false.
Parameters:
reason - the enumerated value for the reason code.

CRLReasonCodeExtension

public CRLReasonCodeExtension(boolean critical,
                              int reason)
                       throws IOException
Create a CRLReasonCodeExtension with the passed in reason.
Parameters:
critical - true if the extension is to be treated as critical.
reason - the enumerated value for the reason code.

CRLReasonCodeExtension

public CRLReasonCodeExtension(Boolean critical,
                              Object value)
                       throws IOException
Create the extension from the passed DER encoded value of the same.
Parameters:
critical - true if the extension is to be treated as critical.
value - Array of DER encoded bytes of the actual value.
Throws:
IOException - on error.
Method Detail

set

public void set(String name,
                Object obj)
         throws IOException
Set the attribute value.
Specified by:
set in interface CertAttrSet

get

public Object get(String name)
           throws IOException
Get the attribute value.
Specified by:
get in interface CertAttrSet

delete

public void delete(String name)
            throws IOException
Delete the attribute value.
Specified by:
delete in interface CertAttrSet

toString

public String toString()
Returns a printable representation of the Reason code.
Specified by:
toString in interface CertAttrSet
Overrides:
toString in class Extension

decode

public void decode(InputStream in)
            throws IOException
Decode the extension from the InputStream - not just the value but the OID, criticality and the extension value.
Specified by:
decode in interface CertAttrSet
Parameters:
in - the InputStream to unmarshal the contents from.
Throws:
IOException - on parsing errors.

encode

public void encode(OutputStream out)
            throws IOException
Write the extension to the DerOutputStream.
Specified by:
encode in interface CertAttrSet
Parameters:
out - the DerOutputStream to write the extension to.
Throws:
IOException - on encoding errors.

getElements

public Enumeration getElements()
Return an enumeration of names of attributes existing within this attribute.
Specified by:
getElements in interface CertAttrSet

getName

public String getName()
Return the name of this attribute.
Specified by:
getName in interface CertAttrSet