KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > geronimo > util > asn1 > x509 > ReasonFlags


1 /**
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * 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  */

17
18 package org.apache.geronimo.util.asn1.x509;
19
20 import org.apache.geronimo.util.asn1.DERBitString;
21
22 /**
23  * The ReasonFlags object.
24  * <pre>
25  * ReasonFlags ::= BIT STRING {
26  * unused (0),
27  * keyCompromise (1),
28  * cACompromise (2),
29  * affiliationChanged (3),
30  * superseded (4),
31  * cessationOfOperation (5),
32  * certificateHold (6),
33  * privilegeWithdrawn (7),
34  * aACompromise (8) }
35  * </pre>
36  */

37 public class ReasonFlags
38     extends DERBitString
39 {
40     /**
41      * @deprecated use lower case version
42      */

43     public static final int UNUSED = (1 << 7);
44     /**
45      * @deprecated use lower case version
46      */

47     public static final int KEY_COMPROMISE = (1 << 6);
48     /**
49      * @deprecated use lower case version
50      */

51     public static final int CA_COMPROMISE = (1 << 5);
52     /**
53      * @deprecated use lower case version
54      */

55     public static final int AFFILIATION_CHANGED = (1 << 4);
56     /**
57      * @deprecated use lower case version
58      */

59     public static final int SUPERSEDED = (1 << 3);
60     /**
61      * @deprecated use lower case version
62      */

63     public static final int CESSATION_OF_OPERATION = (1 << 2);
64     /**
65      * @deprecated use lower case version
66      */

67     public static final int CERTIFICATE_HOLD = (1 << 1);
68     /**
69      * @deprecated use lower case version
70      */

71     public static final int PRIVILEGE_WITHDRAWN = (1 << 0);
72     /**
73      * @deprecated use lower case version
74      */

75     public static final int AA_COMPROMISE = (1 << 15);
76
77     public static final int unused = (1 << 7);
78     public static final int keyCompromise = (1 << 6);
79     public static final int cACompromise = (1 << 5);
80     public static final int affiliationChanged = (1 << 4);
81     public static final int superseded = (1 << 3);
82     public static final int cessationOfOperation = (1 << 2);
83     public static final int certificateHold = (1 << 1);
84     public static final int privilegeWithdrawn = (1 << 0);
85     public static final int aACompromise = (1 << 15);
86
87     /**
88      * @param reasons - the bitwise OR of the Key Reason flags giving the
89      * allowed uses for the key.
90      */

91     public ReasonFlags(
92         int reasons)
93     {
94         super(getBytes(reasons), getPadBits(reasons));
95     }
96
97     public ReasonFlags(
98         DERBitString reasons)
99     {
100         super(reasons.getBytes(), reasons.getPadBits());
101     }
102 }
103
Popular Tags