01: package org.bouncycastle.asn1.x509;
02:
03: import org.bouncycastle.asn1.DERBitString;
04:
05: /**
06: * The ReasonFlags object.
07: * <pre>
08: * ReasonFlags ::= BIT STRING {
09: * 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 extends DERBitString {
21: /**
22: * @deprecated use lower case version
23: */
24: public static final int UNUSED = (1 << 7);
25: /**
26: * @deprecated use lower case version
27: */
28: public static final int KEY_COMPROMISE = (1 << 6);
29: /**
30: * @deprecated use lower case version
31: */
32: public static final int CA_COMPROMISE = (1 << 5);
33: /**
34: * @deprecated use lower case version
35: */
36: public static final int AFFILIATION_CHANGED = (1 << 4);
37: /**
38: * @deprecated use lower case version
39: */
40: public static final int SUPERSEDED = (1 << 3);
41: /**
42: * @deprecated use lower case version
43: */
44: public static final int CESSATION_OF_OPERATION = (1 << 2);
45: /**
46: * @deprecated use lower case version
47: */
48: public static final int CERTIFICATE_HOLD = (1 << 1);
49: /**
50: * @deprecated use lower case version
51: */
52: public static final int PRIVILEGE_WITHDRAWN = (1 << 0);
53: /**
54: * @deprecated use lower case version
55: */
56: public static final int AA_COMPROMISE = (1 << 15);
57:
58: public static final int unused = (1 << 7);
59: public static final int keyCompromise = (1 << 6);
60: public static final int cACompromise = (1 << 5);
61: public static final int affiliationChanged = (1 << 4);
62: public static final int super seded = (1 << 3);
63: public static final int cessationOfOperation = (1 << 2);
64: public static final int certificateHold = (1 << 1);
65: public static final int privilegeWithdrawn = (1 << 0);
66: public static final int aACompromise = (1 << 15);
67:
68: /**
69: * @param reasons - the bitwise OR of the Key Reason flags giving the
70: * allowed uses for the key.
71: */
72: public ReasonFlags(int reasons) {
73: super (getBytes(reasons), getPadBits(reasons));
74: }
75:
76: public ReasonFlags(DERBitString reasons) {
77: super(reasons.getBytes(), reasons.getPadBits());
78: }
79: }
|