01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */package org.apache.geronimo.crypto.asn1.x509;
17:
18: import org.apache.geronimo.crypto.asn1.DERBitString;
19:
20: /**
21: * The ReasonFlags object.
22: * <pre>
23: * ReasonFlags ::= BIT STRING {
24: * unused (0),
25: * keyCompromise (1),
26: * cACompromise (2),
27: * affiliationChanged (3),
28: * superseded (4),
29: * cessationOfOperation (5),
30: * certificateHold (6),
31: * privilegeWithdrawn (7),
32: * aACompromise (8) }
33: * </pre>
34: */
35: public class ReasonFlags extends DERBitString {
36: /**
37: * @deprecated use lower case version
38: */
39: public static final int UNUSED = (1 << 7);
40: /**
41: * @deprecated use lower case version
42: */
43: public static final int KEY_COMPROMISE = (1 << 6);
44: /**
45: * @deprecated use lower case version
46: */
47: public static final int CA_COMPROMISE = (1 << 5);
48: /**
49: * @deprecated use lower case version
50: */
51: public static final int AFFILIATION_CHANGED = (1 << 4);
52: /**
53: * @deprecated use lower case version
54: */
55: public static final int SUPERSEDED = (1 << 3);
56: /**
57: * @deprecated use lower case version
58: */
59: public static final int CESSATION_OF_OPERATION = (1 << 2);
60: /**
61: * @deprecated use lower case version
62: */
63: public static final int CERTIFICATE_HOLD = (1 << 1);
64: /**
65: * @deprecated use lower case version
66: */
67: public static final int PRIVILEGE_WITHDRAWN = (1 << 0);
68: /**
69: * @deprecated use lower case version
70: */
71: public static final int AA_COMPROMISE = (1 << 15);
72:
73: public static final int unused = (1 << 7);
74: public static final int keyCompromise = (1 << 6);
75: public static final int cACompromise = (1 << 5);
76: public static final int affiliationChanged = (1 << 4);
77: public static final int super seded = (1 << 3);
78: public static final int cessationOfOperation = (1 << 2);
79: public static final int certificateHold = (1 << 1);
80: public static final int privilegeWithdrawn = (1 << 0);
81: public static final int aACompromise = (1 << 15);
82:
83: /**
84: * @param reasons - the bitwise OR of the Key Reason flags giving the
85: * allowed uses for the key.
86: */
87: public ReasonFlags(int reasons) {
88: super (getBytes(reasons), getPadBits(reasons));
89: }
90:
91: public ReasonFlags(DERBitString reasons) {
92: super(reasons.getBytes(), reasons.getPadBits());
93: }
94: }
|