001/*
002 *  Licensed to the Apache Software Foundation (ASF) under one
003 *  or more contributor license agreements.  See the NOTICE file
004 *  distributed with this work for additional information
005 *  regarding copyright ownership.  The ASF licenses this file
006 *  to you under the Apache License, Version 2.0 (the
007 *  "License"); you may not use this file except in compliance
008 *  with the License.  You may obtain a copy of the License at
009 *  
010 *    http://www.apache.org/licenses/LICENSE-2.0
011 *  
012 *  Unless required by applicable law or agreed to in writing,
013 *  software distributed under the License is distributed on an
014 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 *  KIND, either express or implied.  See the License for the
016 *  specific language governing permissions and limitations
017 *  under the License. 
018 *  
019 */
020package org.apache.directory.shared.kerberos;
021
022
023/**
024 * An cass to define Kerberos constants
025 *
026 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
027 */
028public class KerberosConstants
029{
030    /** The Kerberos version 5 */
031    public static final int KERBEROS_V5 = 5;
032
033    //-------------------------------------------------------------------------
034    // Messages
035    //-------------------------------------------------------------------------
036    /** Ticket message's tags */
037    public static final int TICKET_TAG = 0x61;
038    public static final int TICKET_TKT_VNO_TAG = 0xA0;
039    public static final int TICKET_REALM_TAG = 0xA1;
040    public static final int TICKET_SNAME_TAG = 0xA2;
041    public static final int TICKET_ENC_PART_TAG = 0xA3;
042
043    /** Authenticator tags */
044    public static final int AUTHENTICATOR_TAG = 0x62;
045    public static final int AUTHENTICATOR_AUTHENTICATOR_VNO_TAG = 0xA0;
046    public static final int AUTHENTICATOR_CREALM_TAG = 0xA1;
047    public static final int AUTHENTICATOR_CNAME_TAG = 0xA2;
048    public static final int AUTHENTICATOR_CKSUM_TAG = 0xA3;
049    public static final int AUTHENTICATOR_CUSEC_TAG = 0xA4;
050    public static final int AUTHENTICATOR_CTIME_TAG = 0xA5;
051    public static final int AUTHENTICATOR_SUBKEY_TAG = 0xA6;
052    public static final int AUTHENTICATOR_SEQ_NUMBER_TAG = 0xA7;
053    public static final int AUTHENTICATOR_AUTHORIZATION_DATA_TAG = 0xA8;
054
055    /** AS-REQ's tags */
056    public static final int AS_REQ_TAG = 0x6A;
057
058    /** AS-REP's tags */
059    public static final int AS_REP_TAG = 0x6B;
060
061    /** TGS-REQ's tags */
062    public static final int TGS_REQ_TAG = 0x6C;
063
064    /** TGS-REP's tags */
065    public static final int TGS_REP_TAG = 0x6D;
066
067    /** AP-REQ tags */
068    public static final int AP_REQ_TAG = 0x6E;
069    public static final int AP_REQ_PVNO_TAG = 0xA0;
070    public static final int AP_REQ_MSG_TYPE_TAG = 0xA1;
071    public static final int AP_REQ_AP_OPTIONS_TAG = 0xA2;
072    public static final int AP_REQ_TICKET_TAG = 0xA3;
073    public static final int AP_REQ_AUTHENTICATOR_TAG = 0xA4;
074
075    /** AP-REP tags */
076    public static final int AP_REP_TAG = 0x6F;
077    public static final int AP_REP_PVNO_TAG = 0xA0;
078    public static final int AP_REP_MSG_TYPE_TAG = 0xA1;
079    public static final int AP_REP_ENC_PART_TAG = 0xA2;
080
081    /** KrbSafe tags */
082    public static final int KRB_SAFE_TAG = 0x74;
083    public static final int KRB_SAFE_PVNO_TAG = 0xA0;
084    public static final int KRB_SAFE_MSGTYPE_TAG = 0xA1;
085    public static final int KRB_SAFE_SAFE_BODY_TAG = 0xA2;
086    public static final int KRB_SAFE_CKSUM_TAG = 0xA3;
087
088    /** KrbPriv */
089    public static final int KRB_PRIV_TAG = 0x75;
090    public static final int KRB_PRIV_PVNO_TAG = 0xA0;
091    public static final int KRB_PRIV_MSGTYPE_TAG = 0xA1;
092    public static final int KRB_PRIV_ENC_PART_TAG = 0xA3;
093
094    /** EncAsRepPart's tags */
095    public static final int ENC_AS_REP_PART_TAG = 0x79;
096
097    /** EncTgsRepPart's tags */
098    public static final int ENC_TGS_REP_PART_TAG = 0x7A;
099
100    /** EncAPRepPart's tags */
101    public static final int ENC_AP_REP_PART_TAG = 0x7B;
102    public static final int ENC_AP_REP_PART_CTIME_TAG = 0xA0;
103    public static final int ENC_AP_REP_PART_CUSEC_TAG = 0xA1;
104    public static final int ENC_AP_REP_PART_SUB_KEY_TAG = 0xA2;
105    public static final int ENC_AP_REP_PART_SEQ_NUMBER_TAG = 0xA3;
106
107    /** EncKrbPrivPart */
108    public static final int ENC_KRB_PRIV_PART_TAG = 0x7C;
109    public static final int ENC_KRB_PRIV_PART_USER_DATA_TAG = 0xA0;
110    public static final int ENC_KRB_PRIV_PART_TIMESTAMP_TAG = 0xA1;
111    public static final int ENC_KRB_PRIV_PART_USEC_TAG = 0xA2;
112    public static final int ENC_KRB_PRIV_PART_SEQ_NUMBER_TAG = 0xA3;
113    public static final int ENC_KRB_PRIV_PART_SENDER_ADDRESS_TAG = 0xA4;
114    public static final int ENC_KRB_PRIV_PART_RECIPIENT_ADDRESS_TAG = 0xA5;
115
116    /** KRB-ERROR tags */
117    public static final int KRB_ERROR_TAG = 0x7E;
118    public static final int KRB_ERROR_PVNO_TAG = 0xA0;
119    public static final int KRB_ERROR_MSGTYPE_TAG = 0xA1;
120    public static final int KRB_ERROR_CTIME_TAG = 0xA2;
121    public static final int KRB_ERROR_CUSEC_TAG = 0xA3;
122    public static final int KRB_ERROR_STIME_TAG = 0xA4;
123    public static final int KRB_ERROR_SUSEC_TAG = 0xA5;
124    public static final int KRB_ERROR_ERROR_CODE_TAG = 0xA6;
125    public static final int KRB_ERROR_CREALM_TAG = 0xA7;
126    public static final int KRB_ERROR_CNAME_TAG = 0xA8;
127    public static final int KRB_ERROR_REALM_TAG = 0xA9;
128    public static final int KRB_ERROR_SNAME_TAG = 0xAA;
129    public static final int KRB_ERROR_ETEXT_TAG = 0xAB;
130    public static final int KRB_ERROR_EDATA_TAG = 0xAC;
131
132    /** KRB-CRED tags */
133    public static final int KRB_CRED_TAG = 0x76;
134    public static final int KRB_CRED_PVNO_TAG = 0xA0;
135    public static final int KRB_CRED_MSGTYPE_TAG = 0xA1;
136    public static final int KRB_CRED_TICKETS_TAG = 0xA2;
137    public static final int KRB_CRED_ENCPART_TAG = 0xA3;
138
139    //-------------------------------------------------------------------------
140    // Components
141    //-------------------------------------------------------------------------
142    /** AD-AND-OR */
143    public static final int AD_AND_OR_CONDITION_COUNT_TAG = 0xA0;
144    public static final int AD_AND_OR_ELEMENTS_TAG = 0xA1;
145
146    /** AD-KDCIssued */
147    public static final int AD_KDC_ISSUED_AD_CHECKSUM_TAG = 0xA0;
148    public static final int AD_KDC_ISSUED_I_REALM_TAG = 0xA1;
149    public static final int AD_KDC_ISSUED_I_SNAME_TAG = 0xA2;
150    public static final int AD_KDC_ISSUED_ELEMENTS_TAG = 0xA3;
151
152    /** AuthorizationData tags */
153    public static final int AUTHORIZATION_DATA_ADTYPE_TAG = 0xA0;
154    public static final int AUTHORIZATION_DATA_ADDATA_TAG = 0xA1;
155
156    /** Checksum tags */
157    public static final int CHECKSUM_TYPE_TAG = 0xA0;
158    public static final int CHECKSUM_CHECKSUM_TAG = 0xA1;
159
160    /** EncKdcRepPart tags */
161    public static final int ENC_KDC_REP_PART_KEY_TAG = 0xA0;
162    public static final int ENC_KDC_REP_PART_LAST_REQ_TAG = 0xA1;
163    public static final int ENC_KDC_REP_PART_NONCE_TAG = 0xA2;
164    public static final int ENC_KDC_REP_PART_KEY_EXPIRATION_TAG = 0xA3;
165    public static final int ENC_KDC_REP_PART_FLAGS_TAG = 0xA4;
166    public static final int ENC_KDC_REP_PART_AUTH_TIME_TAG = 0xA5;
167    public static final int ENC_KDC_REP_PART_START_TIME_TAG = 0xA6;
168    public static final int ENC_KDC_REP_PART_END_TIME_TAG = 0xA7;
169    public static final int ENC_KDC_REP_PART_RENEW_TILL_TAG = 0xA8;
170    public static final int ENC_KDC_REP_PART_SREALM_TAG = 0xA9;
171    public static final int ENC_KDC_REP_PART_SNAME_TAG = 0xAA;
172    public static final int ENC_KDC_REP_PART_CADDR_TAG = 0xAB;
173
174    /** EncKrbCredPart tags */
175    public static final int ENC_KRB_CRED_PART_TAG = 0x7D;
176    public static final int ENC_KRB_CRED_TICKET_INFO_TAG = 0xA0;
177    public static final int ENC_KRB_CRED_PART_NONCE_TAG = 0xA1;
178    public static final int ENC_KRB_CRED_PART_TIMESTAMP_TAG = 0xA2;
179    public static final int ENC_KRB_CRED_PART_USEC_TAG = 0xA3;
180    public static final int ENC_KRB_CRED_PART_SENDER_ADDRESS_TAG = 0xA4;
181    public static final int ENC_KRB_CRED_PART_RECIPIENT_ADDRESS_TAG = 0xA5;
182
183    /** Encrypteddata's tags */
184    public static final int ENCRYPTED_DATA_ETYPE_TAG = 0xA0;
185    public static final int ENCRYPTED_DATA_KVNO_TAG = 0xA1;
186    public static final int ENCRYPTED_DATA_CIPHER_TAG = 0xA2;
187
188    /** EncryptionKey tags */
189    public static final int ENCRYPTION_KEY_TYPE_TAG = 0xA0;
190    public static final int ENCRYPTION_KEY_VALUE_TAG = 0xA1;
191
192    /** EncTicketPart tags */
193    public static final int ENC_TICKET_PART_TAG = 0x63;
194    public static final int ENC_TICKET_PART_FLAGS_TAG = 0xA0;
195    public static final int ENC_TICKET_PART_KEY_TAG = 0xA1;
196    public static final int ENC_TICKET_PART_CREALM_TAG = 0xA2;
197    public static final int ENC_TICKET_PART_CNAME_TAG = 0xA3;
198    public static final int ENC_TICKET_PART_TRANSITED_TAG = 0xA4;
199    public static final int ENC_TICKET_PART_AUTHTIME_TAG = 0xA5;
200    public static final int ENC_TICKET_PART_STARTTIME_TAG = 0xA6;
201    public static final int ENC_TICKET_PART_ENDTIME_TAG = 0xA7;
202    public static final int ENC_TICKET_PART_RENEWTILL_TAG = 0xA8;
203    public static final int ENC_TICKET_PART_CADDR_TAG = 0xA9;
204    public static final int ENC_TICKET_PART_AUTHORIZATION_DATA_TAG = 0xAA;
205
206    /** ETYPE-INFO-ENTRY tags */
207    public static final int ETYPE_INFO_ENTRY_ETYPE_TAG = 0xA0;
208    public static final int ETYPE_INFO_ENTRY_SALT_TAG = 0xA1;
209
210    /** ETYPE-INFO2-ENTRY tags */
211    public static final int ETYPE_INFO2_ENTRY_ETYPE_TAG = 0xA0;
212    public static final int ETYPE_INFO2_ENTRY_SALT_TAG = 0xA1;
213    public static final int ETYPE_INFO2_ENTRY_S2KPARAMS_TAG = 0xA2;
214
215    /** HostAddress' tags */
216    public static final int HOST_ADDRESS_ADDR_TYPE_TAG = 0xA0;
217    public static final int HOST_ADDRESS_ADDRESS_TAG = 0xA1;
218
219    /** KrbCredInfo tags */
220    public static final int KRB_CRED_INFO_KEY_TAG = 0xA0;
221    public static final int KRB_CRED_INFO_PREALM_TAG = 0xA1;
222    public static final int KRB_CRED_INFO_PNAME_TAG = 0xA2;
223    public static final int KRB_CRED_INFO_FLAGS_TAG = 0xA3;
224    public static final int KRB_CRED_INFO_AUTHTIME_TAG = 0xA4;
225    public static final int KRB_CRED_INFO_STARTTIME_TAG = 0xA5;
226    public static final int KRB_CRED_INFO_ENDTIME_TAG = 0xA6;
227    public static final int KRB_CRED_INFO_RENEWTILL_TAG = 0xA7;
228    public static final int KRB_CRED_INFO_SREALM_TAG = 0xA8;
229    public static final int KRB_CRED_INFO_SNAME_TAG = 0xA9;
230    public static final int KRB_CRED_INFO_CADDR_TAG = 0xAA;
231
232    /** KRB-REP's tags */
233    public static final int KDC_REP_PVNO_TAG = 0xA0;
234    public static final int KDC_REP_MSG_TYPE_TAG = 0xA1;
235    public static final int KDC_REP_PA_DATA_TAG = 0xA2;
236    public static final int KDC_REP_CREALM_TAG = 0xA3;
237    public static final int KDC_REP_CNAME_TAG = 0xA4;
238    public static final int KDC_REP_TICKET_TAG = 0xA5;
239    public static final int KDC_REP_ENC_PART_TAG = 0xA6;
240
241    /** KRB-REQ's tags */
242    public static final int KDC_REQ_PVNO_TAG = 0xA1;
243    public static final int KDC_REQ_MSG_TYPE_TAG = 0xA2;
244    public static final int KDC_REQ_PA_DATA_TAG = 0xA3;
245    public static final int KDC_REQ_KDC_REQ_BODY_TAG = 0xA4;
246
247    /** KRB-REQ-BODY's tags */
248    public static final int KDC_REQ_BODY_KDC_OPTIONS_TAG = 0xA0;
249    public static final int KDC_REQ_BODY_CNAME_TAG = 0xA1;
250    public static final int KDC_REQ_BODY_REALM_TAG = 0xA2;
251    public static final int KDC_REQ_BODY_SNAME_TAG = 0xA3;
252    public static final int KDC_REQ_BODY_FROM_TAG = 0xA4;
253    public static final int KDC_REQ_BODY_TILL_TAG = 0xA5;
254    public static final int KDC_REQ_BODY_RTIME_TAG = 0xA6;
255    public static final int KDC_REQ_BODY_NONCE_TAG = 0xA7;
256    public static final int KDC_REQ_BODY_ETYPE_TAG = 0xA8;
257    public static final int KDC_REQ_BODY_ADDRESSES_TAG = 0xA9;
258    public static final int KDC_REQ_BODY_ENC_AUTHZ_DATA_TAG = 0xAA;
259    public static final int KDC_REQ_BODY_ADDITIONAL_TICKETS_TAG = 0xAB;
260
261    /** KrbSafeBody tags */
262    public static final int KRB_SAFE_BODY_USER_DATA_TAG = 0xA0;
263    public static final int KRB_SAFE_BODY_TIMESTAMP_TAG = 0xA1;
264    public static final int KRB_SAFE_BODY_USEC_TAG = 0xA2;
265    public static final int KRB_SAFE_BODY_SEQ_NUMBER_TAG = 0xA3;
266    public static final int KRB_SAFE_BODY_SENDER_ADDRESS_TAG = 0xA4;
267    public static final int KRB_SAFE_BODY_RECIPIENT_ADDRESS_TAG = 0xA5;
268
269    /** LastRequest tags */
270    public static final int LAST_REQ_LR_TYPE_TAG = 0xA0;
271    public static final int LAST_REQ_LR_VALUE_TAG = 0xA1;
272
273    /** PaData tags */
274    public static final int PADATA_TYPE_TAG = 0xA1;
275    public static final int PADATA_VALUE_TAG = 0xA2;
276
277    /** PA-ENC-TS-ENC tags */
278    public static final int PA_ENC_TS_ENC_PA_TIMESTAMP_TAG = 0xA0;
279    public static final int PA_ENC_TS_ENC_PA_USEC_TAG = 0xA1;
280
281    /** PrincipalName's tags */
282    public static final int PRINCIPAL_NAME_NAME_TYPE_TAG = 0xA0;
283    public static final int PRINCIPAL_NAME_NAME_STRING_TAG = 0xA1;
284
285    /** TransitedEncoding tags */
286    public static final int TRANSITED_ENCODING_TR_TYPE_TAG = 0xA0;
287    public static final int TRANSITED_ENCODING_CONTENTS_TAG = 0xA1;
288
289    /** TypedData tags */
290    public static final int TYPED_DATA_TDTYPE_TAG = 0xA0;
291    public static final int TYPED_DATA_TDDATA_TAG = 0xA1;
292    
293    /** CHangePasswdData tags */
294    public static final int CHNGPWD_NEWPWD_TAG = 0xA0;
295    public static final int CHNGPWD_TARGNAME_TAG = 0xA1;
296    public static final int CHNGPWD_TARGREALM_TAG = 0xA2;
297}