1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.directory.shared.kerberos;
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42 public enum KerberosMessageType
43 {
44 TICKET(1, "ticket"),
45 AUTHENTICATOR(2, "Authenticator"),
46 ENC_TICKET_PART(3, "EncTicketPart"),
47 AS_REQ(10, "initial authentication request"),
48 AS_REP(11, "initial authentication response"),
49 TGS_REQ(12, "request for authentication based on TGT"),
50 TGS_REP(13, "response to authentication based on TGT"),
51 AP_REQ(14, "application request"),
52 AP_REP(15, "application response"),
53 KRB_SAFE(20, "safe (checksummed) application message"),
54 KRB_PRIV(21, "private (encrypted) application message"),
55 KRB_CRED(22, "private (encrypted) message to forward credentials"),
56 ENC_AS_REP_PART(25, "encrypted authentication reply part"),
57 ENC_TGS_REP_PART(26, "encrypted TGT reply part"),
58 ENC_AP_REP_PART(27, "encrypted application reply part"),
59 ENC_PRIV_PART(28, "encrypted private message part"),
60 KRB_ERROR(30, "error response");
61
62 private int value;
63 private String message;
64
65
66
67
68
69 private KerberosMessageType( int value, String message )
70 {
71 this.value = value;
72 this.message = message;
73 }
74
75
76
77
78
79
80
81 public int getValue()
82 {
83 return value;
84 }
85
86
87
88
89
90
91
92 public String getMessage()
93 {
94 return message;
95 }
96
97
98
99
100
101
102
103
104 public static KerberosMessageType getTypeByValue( int value )
105 {
106 switch ( value )
107 {
108 case 1:
109 return TICKET;
110 case 2:
111 return AUTHENTICATOR;
112 case 3:
113 return ENC_TICKET_PART;
114 case 10:
115 return AS_REQ;
116 case 11:
117 return AS_REP;
118 case 12:
119 return TGS_REQ;
120 case 13:
121 return TGS_REP;
122 case 14:
123 return AP_REQ;
124 case 15:
125 return AP_REP;
126 case 20:
127 return KRB_SAFE;
128 case 21:
129 return KRB_PRIV;
130 case 22:
131 return KRB_CRED;
132 case 27:
133 return ENC_AP_REP_PART;
134 case 28:
135 return ENC_PRIV_PART;
136 case 30:
137 return KRB_ERROR;
138 default:
139 return null;
140 }
141 }
142 }