m2u-upass-core / src / my / com / upass / Constants.java @ 18:78fbff99ec6c
History | View | Annotate | Download (10.8 KB)
1 |
/*
|
---|---|
2 |
* Copyright TFOS 2009
|
3 |
* date description ---
|
4 |
* 20090420 include tac_max_used feature
|
5 |
*/
|
6 |
package my.com.upass; |
7 |
|
8 |
import java.util.HashMap; |
9 |
|
10 |
/**
|
11 |
* @author Administrator
|
12 |
*
|
13 |
*/
|
14 |
public class Constants extends MinimalConstants { |
15 |
public static final int MODE_QNEXTVAL = 0; |
16 |
public static final int MODE_QCURRVAL = 1; |
17 |
|
18 |
public static final int UID_STATE_LOCKED = 2; |
19 |
public static final int UID_STATE_INACTIVE = 3; |
20 |
public static final int UID_STATE_DELETED = 4; |
21 |
|
22 |
// token state
|
23 |
public static final int TKN_STATE_UNASSIGNED = 0; |
24 |
public static final int TKN_STATE_ASSIGNED = 1; |
25 |
public static final int TKN_STATE_DISABLE = 2; |
26 |
public static final int TKN_STATE_LOCKED = 3; |
27 |
public static final int TKN_STATE_DELETED = 4; |
28 |
|
29 |
public static final int PASSWD_STATUS_DISABLE = 1; |
30 |
public static final int PASSWD_STATUS_ONETIMEUSED = 2; |
31 |
public static final int PASSWD_LIFE_SPAN = 30; |
32 |
// general status
|
33 |
public static final int YES = 0; |
34 |
public static final int NO = 1; |
35 |
public static final int NEVER = 9; |
36 |
|
37 |
public static final int ERR_TOKEN_ALREADY_ASSIGNED = 8; |
38 |
public static final int ERR_TOKEN_NOT_EXIST = 9; |
39 |
public static final int ERR_TAC_ALREADY_EXIST = 12; |
40 |
public static final int ERR_EXCEED_MAX_USE = 13; |
41 |
public static final int ERR_INVALID_SESSION = 14; |
42 |
public static final int ERR_USER_DORMANT = 15; |
43 |
//Additional error code for gemalto application (from code 18 to code 26)
|
44 |
public static final int ERR_BLOBINVALID = 18; |
45 |
public static final int ERR_BUFFER = 19; |
46 |
public static final int ERR_PARAM = 20; |
47 |
public static final int ERR_SNOINVALID = 21; |
48 |
public static final int ERR_OTPINVALID = 22; |
49 |
public static final int ERR_BLOBOTINIT = 23; |
50 |
public static final int ERR_FAILED = 24; |
51 |
public static final int ERR_REQINVALID = 25; |
52 |
public static final int ERR_AUTH_MODE = 26; |
53 |
|
54 |
|
55 |
public static final int ERR_UNKNOWN = 99; |
56 |
public static final int ERR_SECURITY_CODE_ALREADY_EXIST = 32; |
57 |
|
58 |
//Additional error code for secure metric application (from code 102 to code 215)
|
59 |
public static final int OTPR_CORE_COMMON_FAIL = 101; |
60 |
public static final int OTPR_CORE_COMMON_INVALID_PARAMETER = 102; |
61 |
public static final int OTPR_CORE_COMMON_INVALID_LICENSE = 103; |
62 |
public static final int OTPR_CORE_COMMON_EXPIRED_LICENSE = 104; |
63 |
public static final int OTPR_CORE_AUTH_OK = 105; |
64 |
public static final int OTPR_CORE_UID_EMPTY = 106; |
65 |
public static final int OTPR_CORE_OTP_EMPTY = 107; |
66 |
public static final int OTPR_CORE_PIN_EMPTY = 108; |
67 |
public static final int OTPR_CORE_TSN_EMPTY = 109; |
68 |
public static final int OTPR_CORE_INVALID_UID = 110; |
69 |
public static final int OTPR_CORE_INVALID_OTP = 111; |
70 |
public static final int OTPR_CORE_INVALID_TOKENKEY = 112; |
71 |
public static final int OTPR_CORE_INVALID_AUTHNUM = 113; |
72 |
public static final int OTPR_CORE_NEED_SYNC = 114; |
73 |
public static final int OTPR_CORE_INVALID_TIMEDRIFT = 115; |
74 |
public static final int OTPR_CORE_INVALID_USERPIN = 116; |
75 |
public static final int OTPR_CORE_INVALID_DBUPIN = 117; |
76 |
public static final int OTPR_CORE_ERR_GETUSER = 118; |
77 |
public static final int OTPR_CORE_ERR_GETTOKEN = 119; |
78 |
public static final int OTPR_CORE_TOKEN_LOCKED = 110; |
79 |
public static final int OTPR_CORE_LOGIN_LOCKED = 111; |
80 |
public static final int OTPR_CORE_PIN_NOTINIT = 112; |
81 |
public static final int OTPR_CORE_INVALID_TOKENTYPE = 113; |
82 |
public static final int OTPR_CORE_INVALID_TOKENSN = 114; |
83 |
public static final int OTPR_CORE_ERR_GETASSIGNED = 115; |
84 |
public static final int OTPR_CORE_ERR_GETTOKENNUM = 116; |
85 |
public static final int OTPR_CORE_TOKEN_BINDED = 117; |
86 |
public static final int OTPR_CORE_BIND_EXCEED = 118; |
87 |
public static final int OTPR_CORE_NEED_VERIFYPIN = 119; |
88 |
public static final int OTPR_CORE_USER_INACTIVE = 120; |
89 |
public static final int OTPR_CORE_AGENT_EMPTY = 121; |
90 |
public static final int OTPR_CORE_HOST_EMPTY = 122; |
91 |
public static final int OTPR_CORE_SHARE_KEY_EMPTY = 123; |
92 |
public static final int OTPR_CORE_DB_INVALID_CONFIGFILE = 124; |
93 |
public static final int OTPR_CORE_DB_INVALID_DBTYPE = 125; |
94 |
public static final int OTPR_CORE_DB_ERROR_CONNECT = 126; |
95 |
public static final int OTPR_CORE_DB_DATASOURCE_NOTFOUND = 127; |
96 |
public static final int OTPR_CORE_DB_DATABASE_NOTFOUND = 128; |
97 |
public static final int OTPR_CORE_DB_SERVER_NOTFOUND = 129; |
98 |
public static final int OTPR_CORE_DB_INVALID_AUTH = 130; |
99 |
public static final int OTPR_CORE_DB_NOTBEUSED_CONNECT = 131; |
100 |
public static final int OTPR_CORE_DB_TOOMANY_CONNECT = 132; |
101 |
public static final int OTPR_CORE_DB_USERSOURCE_ESTOP = 133; |
102 |
public static final int OTPR_CORE_DB_USER_EXISTS = 134; |
103 |
public static final int OTPR_CORE_DB_USER_NOTEXISTS = 135; |
104 |
public static final int OTPR_CORE_DB_RECORD_NOTEXISTS = 136; |
105 |
public static final int OTPR_CORE_DB_TOKEN_EXISTS = 137; |
106 |
public static final int OTPR_CORE_DB_TOKEN_NOTEXISTS = 138; |
107 |
public static final int OTPR_CORE_DB_AGENT_EXISTS = 139; |
108 |
public static final int OTPR_CORE_DB_AGENT_NOTEXISTS = 140; |
109 |
public static final int OTPR_CORE_DB_HOST_EXISTS = 141; |
110 |
public static final int OTPR_CORE_DB_HOST_NOTEXISTS = 142; |
111 |
public static final int OTPR_CORE_DB_INVALID_USERSOURCETYPE = 143; |
112 |
public static final int OTPR_CORE_DB_NOTENOUGH_BUFFER = 144; |
113 |
public static final int OTPR_CORE_DB_ERROR_QUERY = 145; |
114 |
public static final int OTPR_CORE_DB_ADD_USER_FAILED = 146; |
115 |
public static final int OTPR_CORE_DB_DEL_USER_FAILED = 147; |
116 |
public static final int OTPR_CORE_DB_QUERY_USER_FAILED = 148; |
117 |
public static final int OTPR_CORE_DB_UPDATE_USER_FAILED = 149; |
118 |
public static final int OTPR_CORE_DB_ADD_TOKEN_FAILED = 150; |
119 |
public static final int OTPR_CORE_DB_DEL_TOKEN_FAILED = 151; |
120 |
public static final int OTPR_CORE_DB_QUERY_TOKEN_FAILED = 152; |
121 |
public static final int OTPR_CORE_DB_UPDATE_TOKEN_FAILED = 153; |
122 |
public static final int OTPR_CORE_DB_BIND_USER_TOKEN_FAILED = 154; |
123 |
public static final int OTPR_CORE_DB_UNBIND_USER_TOKEN_FAILED = 155; |
124 |
public static final int OTPR_CORE_DB_USER_TOKEN_UNBIND = 156; |
125 |
public static final int OTPR_CORE_DB_ADD_AGENT_FAILED = 157; |
126 |
public static final int OTPR_CORE_DB_DEL_AGENT_FAILED = 158; |
127 |
public static final int OTPR_CORE_DB_CHANGE_AGENT_FAILED = 159; |
128 |
public static final int OTPR_CORE_DB_QUERY_AGENT_FAILED = 160; |
129 |
public static final int OTPR_CORE_DB_ADD_HOST_FAILED = 161; |
130 |
public static final int OTPR_CORE_DB_DEL_HOST_FAILED = 162; |
131 |
public static final int OTPR_CORE_DB_CHANGE_HOST_FAILED = 163; |
132 |
public static final int OTPR_CORE_DB_QUERY_HOST_FAILED = 164; |
133 |
public static final int OTPR_CORE_DB_ADD_AGENT_HOST_FAILED = 165; |
134 |
public static final int OTPR_CORE_DB_DEL_AGENT_HOST_FAILED = 166; |
135 |
public static final int OTPR_CORE_DB_CHANGE_AGENT_HOST_FAILED = 167; |
136 |
public static final int OTPR_CORE_DB_QUERY_AGENT_HOST_FAILED = 168; |
137 |
public static final int OTPR_CORE_DB_ADD_LOG_FAILED = 169; |
138 |
public static final int OTPR_CORE_DB_DEL_LOG_FAILED = 170; |
139 |
public static final int OTPR_CORE_DB_CHANGE_LOG_FAILED = 171; |
140 |
public static final int OTPR_CORE_DB_QUERY_LOG_FAILED = 172; |
141 |
public static final int OTPR_CORE_DB_ADD_CONFIG_FAILED = 173; |
142 |
public static final int OTPR_CORE_DB_DEL_CONFIG_FAILED = 174; |
143 |
public static final int OTPR_CORE_DB_CHANGE_CONFIG_FAILED = 175; |
144 |
public static final int OTPR_CORE_DB_QUERY_CONFIG_FAILED = 176; |
145 |
public static final int OTPR_CORE_DB_ADD_ADMIN_GROUP_FAILED = 177; |
146 |
public static final int OTPR_CORE_DB_DEL_ADMIN_GROUP_FAILED = 178; |
147 |
public static final int OTPR_CORE_DB_CHANGE_ADMIN_GROUP_FAILED = 179; |
148 |
public static final int OTPR_CORE_DB_QUERY_ADMIN_GROUP_FAILED = 180; |
149 |
public static final int OTPR_CORE_DB_ADD_ADMIN_LOG_FAILED = 181; |
150 |
public static final int OTPR_CORE_DB_DEL_ADMIN_LOG_FAILED = 182; |
151 |
public static final int OTPR_CORE_DB_CHANGE_ADMIN_LOG_FAILED = 183; |
152 |
public static final int OTPR_CORE_DB_QUERY_ADMIN_LOG_FAILED = 184; |
153 |
public static final int OTPR_CORE_DB_ADD_ADMIN_USER_FAILED = 185; |
154 |
public static final int OTPR_CORE_DB_DEL_ADMIN_USER_FAILED = 186; |
155 |
public static final int OTPR_CORE_DB_CHANGE_ADMIN_USER_FAILED = 187; |
156 |
public static final int OTPR_CORE_DB_QUERY_ADMIN_USER_FAILED = 188; |
157 |
public static final int OTPR_CORE_DB_ADD_DOMAIN_FAILED = 189; |
158 |
public static final int OTPR_CORE_DB_DEL_DOMAIN_FAILED = 190; |
159 |
public static final int OTPR_CORE_DB_CHANGE_DOMAIN_FAILED = 191; |
160 |
public static final int OTPR_CORE_DB_QUERY_DOMAIN_FAILED = 192; |
161 |
public static final int OTPR_CORE_DB_ADD_TEMP_USER_FAILED = 193; |
162 |
public static final int OTPR_CORE_DB_DEL_TEMP_USER_FAILED = 194; |
163 |
public static final int OTPR_CORE_DB_CHANGE_TEMP_USER_FAILED = 195; |
164 |
public static final int OTPR_CORE_DB_QUERY_TEMP_USER_FAILED = 196; |
165 |
public static final int OTPR_CORE_DB_RELOAD_CONNECTION_FAILED = 197; |
166 |
public static final int OTPR_CORE_COMM_EXPIRED_LOG4J = 198; |
167 |
public static final int OTPR_CORE_DB_ADD_APPGROUP_FAILED = 199; |
168 |
public static final int OTPR_CORE_DB_DEL_APPGROUP_FAILED = 200; |
169 |
public static final int OTPR_CORE_DB_CHANGE_APPGROUP_FAILED = 201; |
170 |
public static final int OTPR_CORE_DB_QUERY_APPGROUP_FAILED = 202; |
171 |
public static final int OTPR_CORE_DB_ADD_USER_GROUP_FAILED = 203; |
172 |
public static final int OTPR_CORE_DB_DEL_USER_GROUP_FAILED = 204; |
173 |
public static final int OTPR_CORE_DB_CHANGE_USER_GROUP_FAILED = 205; |
174 |
public static final int OTPR_CORE_DB_QUERY_USER_GROUP_FAILED = 206; |
175 |
public static final int OTPR_CORE_DB_ADD_ZONE_FAILED = 207; |
176 |
public static final int OTPR_CORE_DB_DEL_ZONE_FAILED = 208; |
177 |
public static final int OTPR_CORE_DB_CHANGE_ZONE_FAILED = 209; |
178 |
public static final int OTPR_CORE_DB_QUERY_ZONE_FAILED = 210; |
179 |
public static final int OTPR_CORE_DB_ADD_LICENSE_FAILED = 211; |
180 |
public static final int OTPR_CORE_DB_DEL_LICENSE_FAILED = 212; |
181 |
public static final int OTPR_CORE_DB_CHANGE_LICENSE_FAILED = 213; |
182 |
public static final int OTPR_CORE_DB_QUERY_LICENSE_FAILED = 214; |
183 |
public static final int OTPR_CORE_DB_LDAP_INIT_FAILED = 215; |
184 |
|
185 |
//Gemalto application's required parameters;
|
186 |
public static final String OCRASUITE = "OCRA-1:HOTP-SHA1-8:QH64-T30S"; |
187 |
public static final int TIMESTEPUSED = 30; //default is 30 due to S'pore regulation |
188 |
|
189 |
//Gemalto authentication mode
|
190 |
public static HashMap <String,Integer> authModeMapInstance = null; |
191 |
|
192 |
public static HashMap<String,Integer> getAuthInstance() |
193 |
{ |
194 |
if (authModeMapInstance==null) |
195 |
{ |
196 |
authModeMapInstance = new HashMap<String,Integer>(); |
197 |
|
198 |
authModeMapInstance.put("AUTH_HOTP", 0x00000001);//Event based. Not in use. |
199 |
authModeMapInstance.put("AUTH_HOTP2", 0x00000002);//Event based. Not in use. |
200 |
authModeMapInstance.put("AUTH_TOTP", 0x00000004);//Time based. |
201 |
authModeMapInstance.put("AUTH_OCRA", 0x00000008);//OCRA Challenge response based. |
202 |
} |
203 |
|
204 |
return authModeMapInstance;
|
205 |
} |
206 |
|
207 |
public static int getAuthenticationMode(String authMode) |
208 |
{ |
209 |
return getAuthInstance().get(authMode);
|
210 |
} |
211 |
|
212 |
public static final String TYPE_SYSTEM = "SYSTEM"; |
213 |
public static final int SYSTEM_ID = 0; |
214 |
|
215 |
} |