1    package org.bouncycastle.asn1.x509;
2    
3    import org.bouncycastle.asn1.*;
4    
5    public class ReasonFlags
6        extends DERBitString
7    {
8        public static final int UNUSED                  = (1 << 7);
9        public static final int KEY_COMPROMISE          = (1 << 6);
10       public static final int CA_COMPROMISE           = (1 << 5);
11       public static final int AFFILIATION_CHANGED     = (1 << 4);
12       public static final int SUPERSEDED              = (1 << 3);
13       public static final int CESSATION_OF_OPERATION  = (1 << 2);
14       public static final int CERTIFICATE_HOLD        = (1 << 1);
15       public static final int PRIVILEGE_WITHDRAWN     = (1 << 0);
16       public static final int AA_COMPROMISE           = (1 << 15);
17   
18       /**
19        * <pre>
20        * ReasonFlags ::= BIT STRING {
21        *    unused(0),
22        *    keyCompromise(1),
23        *    cACompromise(2),
24        *    affiliationChanged(3),
25        *    superseded(4),
26        *    cessationOfOperation(5),
27        *    certficateHold(6)
28        * }
29        * </pre>
30        * @param reasons - the bitwise OR of the Key Reason flags giving the
31        * allowed uses for the key.
32        */
33       public ReasonFlags(
34           int reasons)
35       {
36           super(getBytes(reasons), getPadBits(reasons));
37       }
38   
39       public ReasonFlags(
40           DERBitString reasons)
41       {
42           super(reasons.getBytes(), reasons.getPadBits());
43       }
44   }
45