Statistics
| Branch: | Revision:

m2u-upass-core / src / my / com / upass / Constants.java @ 66:15ff3833b2a7

History | View | Annotate | Download (10.6 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
        // token state
19
        public static final int TKN_STATE_UNASSIGNED = 0;
20
        public static final int TKN_STATE_ASSIGNED = 1;
21
        public static final int TKN_STATE_DISABLE = 2;
22
        public static final int TKN_STATE_LOCKED = 3;
23
        public static final int TKN_STATE_DELETED = 4;
24
        
25
        public static final int PASSWD_STATUS_DISABLE = 1;
26
        public static final int PASSWD_STATUS_ONETIMEUSED = 2;
27
        public static final int PASSWD_LIFE_SPAN = 30;
28
        // general status
29
        public static final int YES = 0;
30
        public static final int NO = 1;
31
        public static final int NEVER = 9;
32

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