public class

CRLReasonCodeExtension

extends Extension
implements CertAttrSet<T>
java.lang.Object
   ↳ sun.security.x509.Extension
     ↳ sun.security.x509.CRLReasonCodeExtension

Class Overview

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),
    privilegeWithdrawn      (9),
    aACompromise           (10) }
 

Summary

Constants
int AA_COMPROMISE
int AFFLIATION_CHANGED
int CA_COMPROMISE
int CERTIFICATE_HOLD
int CESSATION_OF_OPERATION
int KEY_COMPROMISE
String NAME Attribute name and Reason codes
int PRIVILEGE_WITHDRAWN
String REASON
int REMOVE_FROM_CRL
int SUPERSEDED
int UNSPECIFIED
[Expand]
Inherited Fields
From class sun.security.x509.Extension
Public Constructors
CRLReasonCodeExtension(int reason)
Create a CRLReasonCodeExtension with the passed in reason.
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.
Public Methods
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<String> 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.
[Expand]
Inherited Methods
From class sun.security.x509.Extension
From class java.lang.Object
From interface sun.security.x509.CertAttrSet

Constants

public static final int AA_COMPROMISE

Constant Value: 10 (0x0000000a)

public static final int AFFLIATION_CHANGED

Constant Value: 3 (0x00000003)

public static final int CA_COMPROMISE

Constant Value: 2 (0x00000002)

public static final int CERTIFICATE_HOLD

Constant Value: 6 (0x00000006)

public static final int CESSATION_OF_OPERATION

Constant Value: 5 (0x00000005)

public static final int KEY_COMPROMISE

Constant Value: 1 (0x00000001)

public static final String NAME

Attribute name and Reason codes

Constant Value: "CRLReasonCode"

public static final int PRIVILEGE_WITHDRAWN

Constant Value: 9 (0x00000009)

public static final String REASON

Constant Value: "reason"

public static final int REMOVE_FROM_CRL

Constant Value: 8 (0x00000008)

public static final int SUPERSEDED

Constant Value: 4 (0x00000004)

public static final int UNSPECIFIED

Constant Value: 0 (0x00000000)

Public Constructors

public CRLReasonCodeExtension (int reason)

Create a CRLReasonCodeExtension with the passed in reason. Criticality automatically set to false.

Parameters
reason the enumerated value for the reason code.
Throws
IOException

public CRLReasonCodeExtension (boolean critical, int reason)

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.
Throws
IOException

public CRLReasonCodeExtension (Boolean critical, Object value)

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 an array of DER encoded bytes of the actual value.
Throws
ClassCastException if value is not an array of bytes
IOException on error.

Public Methods

public void delete (String name)

Delete the attribute value.

Parameters
name the name of the attribute to delete.
Throws
IOException

public void encode (OutputStream out)

Write the extension to the DerOutputStream.

Parameters
out the DerOutputStream to write the extension to.
Throws
IOException on encoding errors.

public Object get (String name)

Get the attribute value.

Parameters
name the name of the attribute to return.
Throws
IOException

public Enumeration<String> getElements ()

Return an enumeration of names of attributes existing within this attribute.

Returns
  • an enumeration of the attribute names.

public String getName ()

Return the name of this attribute.

Returns
  • the name of this CertAttrSet.

public void set (String name, Object obj)

Set the attribute value.

Parameters
name the name of the attribute (e.g. "x509.info.key")
obj the attribute object.
Throws
IOException

public String toString ()

Returns a printable representation of the Reason code.

Returns
  • a string representation of the object.