Home | History | Annotate | Download | only in x509
      1 package org.bouncycastle.asn1.x509;
      2 
      3 import org.bouncycastle.asn1.DERBitString;
      4 
      5 /**
      6  * The ReasonFlags object.
      7  * <pre>
      8  * ReasonFlags ::= BIT STRING {
      9  *      unused                  (0),
     10  *      keyCompromise           (1),
     11  *      cACompromise            (2),
     12  *      affiliationChanged      (3),
     13  *      superseded              (4),
     14  *      cessationOfOperation    (5),
     15  *      certificateHold         (6),
     16  *      privilegeWithdrawn      (7),
     17  *      aACompromise            (8) }
     18  * </pre>
     19  */
     20 public class ReasonFlags
     21     extends DERBitString
     22 {
     23     /**
     24      * @deprecated use lower case version
     25      */
     26     public static final int UNUSED                  = (1 << 7);
     27     /**
     28      * @deprecated use lower case version
     29      */
     30     public static final int KEY_COMPROMISE          = (1 << 6);
     31     /**
     32      * @deprecated use lower case version
     33      */
     34     public static final int CA_COMPROMISE           = (1 << 5);
     35     /**
     36      * @deprecated use lower case version
     37      */
     38     public static final int AFFILIATION_CHANGED     = (1 << 4);
     39     /**
     40      * @deprecated use lower case version
     41      */
     42     public static final int SUPERSEDED              = (1 << 3);
     43     /**
     44      * @deprecated use lower case version
     45      */
     46     public static final int CESSATION_OF_OPERATION  = (1 << 2);
     47     /**
     48      * @deprecated use lower case version
     49      */
     50     public static final int CERTIFICATE_HOLD        = (1 << 1);
     51     /**
     52      * @deprecated use lower case version
     53      */
     54     public static final int PRIVILEGE_WITHDRAWN     = (1 << 0);
     55     /**
     56      * @deprecated use lower case version
     57      */
     58     public static final int AA_COMPROMISE           = (1 << 15);
     59 
     60     public static final int unused                  = (1 << 7);
     61     public static final int keyCompromise           = (1 << 6);
     62     public static final int cACompromise            = (1 << 5);
     63     public static final int affiliationChanged      = (1 << 4);
     64     public static final int superseded              = (1 << 3);
     65     public static final int cessationOfOperation    = (1 << 2);
     66     public static final int certificateHold         = (1 << 1);
     67     public static final int privilegeWithdrawn      = (1 << 0);
     68     public static final int aACompromise            = (1 << 15);
     69 
     70     /**
     71      * @param reasons - the bitwise OR of the Key Reason flags giving the
     72      * allowed uses for the key.
     73      */
     74     public ReasonFlags(
     75         int reasons)
     76     {
     77         super(getBytes(reasons), getPadBits(reasons));
     78     }
     79 
     80     public ReasonFlags(
     81         DERBitString reasons)
     82     {
     83         super(reasons.getBytes(), reasons.getPadBits());
     84     }
     85 }
     86