KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ejbca > core > model > SecConst


1 /*************************************************************************
2  * *
3  * EJBCA: The OpenSource Certificate Authority *
4  * *
5  * This software is free software; you can redistribute it and/or *
6  * modify it under the terms of the GNU Lesser General Public *
7  * License as published by the Free Software Foundation; either *
8  * version 2.1 of the License, or any later version. *
9  * *
10  * See terms of license at gnu.org. *
11  * *
12  *************************************************************************/

13  
14 package org.ejbca.core.model;
15
16 /**
17  * Constants for users and certificates. Constants for Type of user: Type is constructed as a mask
18  * since one user can be of several types. To test a user type:
19  * <pre>
20  * if (((type & USER_ENDUSER) == USER_ENDUSER) && ((type & USER_CAADMIN) == USER_ADMINISTOR) || ...
21  * ...
22  * </pre>
23  * Bit usage: bits 0-7 (1:st byte): user types bits 8-15 (2:nd byte): unused bits 16-23 (3:rd
24  * byte): unused bits 24-30 (4:th byte): unused Constants for certificates are simple integer
25  * types. Constants for Token Types Token type is constructed of integer constants since only one
26  * token type can be generated.
27  *
28  * @version $Id: SecConst.java,v 1.5 2006/11/11 12:46:05 herrvendil Exp $
29  */

30 public class SecConst extends Object JavaDoc {
31     // User types
32

33     /** Dummy type. */
34     public static final int USER_INVALID = 0x0;
35
36     /** This is an end user certificate (default). */
37     public static final int USER_ENDUSER = 0x1;
38
39     /** This user is an administrator. */
40     public static final int USER_ADMINISTRATOR = 0x40;
41
42     /** This users keystores are key recoverable. */
43     public static final int USER_KEYRECOVERABLE = 0x80;
44
45     /** Notification will be sent to this users emailaddress */
46     public static final int USER_SENDNOTIFICATION = 0x100;
47     
48     /** Notification will be sent to this users emailaddress */
49     public static final int USER_PRINT = 0x200;
50
51
52     // Token types.
53

54     /** Indicates that a browser generated token should be used. */
55     public static final int TOKEN_SOFT_BROWSERGEN = 1;
56
57     /** Indicates that a p12 token should be generated. */
58     public static final int TOKEN_SOFT_P12 = 2;
59
60     /** Indicates that a jks token should be generated. */
61     public static final int TOKEN_SOFT_JKS = 3;
62
63     /** Indicates that a pem token should be generated. */
64     public static final int TOKEN_SOFT_PEM = 4;
65
66     /** All values equal or below this constant should be treated as a soft token. */
67     public static final int TOKEN_SOFT = 100;
68     
69     public static final String JavaDoc[] TOKENTEXTS = {"TOKENSOFTBROWSERGEN","TOKENSOFTP12","TOKENSOFTJKS","TOKENSOFTPEM"};
70     
71     public static final int[] TOKENIDS = {SecConst.TOKEN_SOFT_BROWSERGEN,SecConst.TOKEN_SOFT_P12,SecConst.TOKEN_SOFT_JKS,SecConst.TOKEN_SOFT_PEM};
72
73     /** Constant indicating a standard hard token, defined in scaper. */
74     public static final int TOKEN_HARD_DEFAULT = 101;
75
76     /** Constant indicating a eid hard token.
77      * OBSERVE This class should only be used for backward compability with EJBCA 2.0
78      */

79     public static final int TOKEN_EID = 102;
80     
81     /**Constant indicating a swedish eid hard token. */
82     public static final int TOKEN_SWEDISHEID = 103;
83
84     /**Constant indicating a enhanced eid hard token. */
85     public static final int TOKEN_ENHANCEDEID = 104;
86     
87     /**Constant indicating a enhanced eid hard token. */
88     public static final int TOKEN_TURKISHEID = 105;
89     
90     // Certificate profiles.
91

92     public static final int NO_HARDTOKENISSUER = 0;
93
94     public static final int CERTPROFILE_FIXED_ENDUSER = 1;
95     public static final int CERTPROFILE_FIXED_SUBCA = 2;
96     public static final int CERTPROFILE_FIXED_ROOTCA = 3;
97     public static final int CERTPROFILE_FIXED_OCSPSIGNER = 4;
98     public static final int CERTPROFILE_FIXED_HARDTOKENAUTH = 5;
99     public static final int CERTPROFILE_FIXED_HARDTOKENAUTHENC= 6;
100     public static final int CERTPROFILE_FIXED_HARDTOKENENC = 7;
101     public static final int CERTPROFILE_FIXED_HARDTOKENSIGN = 8;
102     
103     public static final int EMPTY_ENDENTITYPROFILE = 1;
104
105     public static final int ALLCAS = 1;
106         
107     /**
108      * Constants defining range of id's reserved for fixed certificate types. Observe fixed
109      * certificates cannot have value 0.
110      */

111     public static final int FIXED_CERTIFICATEPROFILE_BOUNDRY = 1000;
112     public static final int PROFILE_NO_PROFILE = 0;
113
114     
115     /**
116      * Constants used in the RSASignSessionBean indicating the userdata defined CA should be used.
117      */

118     public static final int CAID_USEUSERDEFINED = 0;
119
120     /** Constant used to determine the size of the result from SQL select queries */
121     public static final int MAXIMUM_QUERY_ROWCOUNT = 100;
122     
123     
124     /** Constans used to indicate status of a CA. */
125     public static final int CA_ACTIVE = 1;
126     public static final int CA_WAITING_CERTIFICATE_RESPONSE = 2;
127     public static final int CA_EXPIRED = 3;
128     public static final int CA_REVOKED = 4;
129     public static final int CA_OFFLINE = 5;
130     public static final int CA_EXTERNAL = 6;
131     
132     public static final int CAKEYPURPOSE_CERTSIGN = 1;
133     public static final int CAKEYPURPOSE_CRLSIGN = 2;
134     public static final int CAKEYPURPOSE_KEYENCRYPT = 3;
135     public static final int CAKEYPURPOSE_KEYTEST = 4;
136
137     /**
138      * Prevents creation of new SecConst
139      */

140     private SecConst() {
141     }
142 }
143
144
145 // SecConst
146
Popular Tags