|
1 /* |
|
2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: General definitions used in message passing between |
|
15 * client and server |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef __WIMCLSV_H__ |
|
21 #define __WIMCLSV_H__ |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <securitydefs.h> |
|
26 #include "WimOpcode.h" |
|
27 #include "WimConsts.h" |
|
28 #include "WimDefs.h" |
|
29 #include <secdlg.h> |
|
30 |
|
31 |
|
32 // CONSTANTS |
|
33 _LIT( KWIMServerName, "WIMIServer" ); |
|
34 |
|
35 // Number allocation for our certificates. Includes only WTLS CA |
|
36 // certificates. |
|
37 const TUid KUidWTLSTrustedCerts = {0x1000AA53}; |
|
38 |
|
39 // Number allocation for our certificates. Includes only X509 client |
|
40 // certificates. |
|
41 const TUid KUidWTLSUserCerts = {0x1000AB5B}; |
|
42 |
|
43 // A version must be specifyed when creating a session with the server |
|
44 const TUint KWIMServMajorVersionNumber = 1; |
|
45 const TUint KWIMServMinorVersionNumber = 0; |
|
46 const TUint KWIMServBuildVersionNumber = 1; |
|
47 |
|
48 // needed for creating server thread. |
|
49 const TUint KWIMDefaultHeapSize = 0x100000; |
|
50 |
|
51 // Maximum count of applications trusting to certificate |
|
52 const TInt KMaxApplicationCount = 50; |
|
53 |
|
54 // Mask for PIN status. Keeping MSBs and masking off LSBs. |
|
55 const TUint8 KPINStatusMask = 0xF0; |
|
56 const TUint8 KWimAuthObjectBlocked= 0x08; |
|
57 |
|
58 // Typedefs for the references to wim, pin and certificate |
|
59 typedef TUint32 TWimAddress; |
|
60 typedef TWimAddress* TWimAddressList; |
|
61 typedef TWimAddress TPinAddress; |
|
62 typedef TWimAddress* TPinAddressList; |
|
63 typedef TUint32 TCertificateAddress; |
|
64 typedef TCertificateAddress* TCertificateAddressList; |
|
65 |
|
66 // Server panic reasons |
|
67 enum TWimServerPanic |
|
68 { |
|
69 EWimMainSchedulerError, |
|
70 EWimSvrCreateServer, |
|
71 EWimCreateTrapCleanup, |
|
72 EWimSubSessionRefCountInvalid, |
|
73 EWimThreadOpenError, |
|
74 EWimIncorrectPolicy |
|
75 }; |
|
76 |
|
77 // PIN status |
|
78 typedef TUint8 TWimPinStatus; |
|
79 |
|
80 //PIN Type |
|
81 enum TWimPin |
|
82 { |
|
83 EWimPinG, |
|
84 EWimPinNR |
|
85 }; |
|
86 |
|
87 // WIM information structure |
|
88 struct TWimSecModuleStruct |
|
89 { |
|
90 TBuf<KLabelLen> iLabel; |
|
91 TBuf<KManufacturerLen> iManufacturer; |
|
92 TBuf<KSerialNumberLen> iSerialNumber; |
|
93 TUint8 iVersion; |
|
94 TUint8 iReader; |
|
95 TPinAddress iRefPinG; |
|
96 }; |
|
97 |
|
98 // PIN information structure |
|
99 struct TWimPinStruct |
|
100 { |
|
101 TWimPin iPinType; |
|
102 TBuf<KLabelLen> iLabel; |
|
103 TWimPinStatus iStatus; |
|
104 TUint8 iPinNumber; |
|
105 }; |
|
106 |
|
107 // Certificate info structure |
|
108 struct TWimCertAddParameters |
|
109 { |
|
110 TBuf8<KLabelLen> iLabel; |
|
111 TBuf8<KKeyIdLen> iKeyId; |
|
112 TBuf8<KCertHash> iCaId; |
|
113 TWimCertType iUsage; |
|
114 TWimCertFormat iFormat; |
|
115 }; |
|
116 |
|
117 // Certificate details |
|
118 struct TWimCertDetails |
|
119 { |
|
120 TPtr8* iCert; //The whole cert |
|
121 }; |
|
122 |
|
123 // Address of a certificate to be removed |
|
124 struct TWimCertRemoveAddr |
|
125 { |
|
126 TCertificateAddress iCertAddr; |
|
127 TWimCertLocation iLocation; |
|
128 }; |
|
129 |
|
130 // Certificate information structure |
|
131 struct TWimCertInfo |
|
132 { |
|
133 TBuf8<KLabelLen> iLabel; |
|
134 TBuf8<KKeyIdLen> iKeyId; |
|
135 TBuf8<KCertHash> iCAId; |
|
136 TBuf8<KIssuerHash> iIssuerHash; |
|
137 TUint8 iCDFRefs; |
|
138 TUint iUsage; |
|
139 TUint iType; |
|
140 TUint iCertlen; |
|
141 TUint iModifiable; |
|
142 TUint iTrustedUsageLength; |
|
143 }; |
|
144 |
|
145 // Certificate extra information structure |
|
146 struct TCertExtrasInfo |
|
147 { |
|
148 TPtr* iTrustedUsage; |
|
149 TUint8 iCDFRefs; |
|
150 }; |
|
151 |
|
152 // Key info struct |
|
153 struct TKeyInfo |
|
154 { |
|
155 TUint8 iKeyNumber; |
|
156 TUint8 iType; //1 = rsa, 2 = ECC |
|
157 TUint16 iUsage; |
|
158 TBuf8<KLabelLen> iLabel; |
|
159 TBuf8<KKeyIdLen> iKeyId; |
|
160 TUint16 iLength; |
|
161 TUint8 iPinNumber; |
|
162 }; |
|
163 |
|
164 // Digital signature struct |
|
165 struct TKeySignParameters |
|
166 { |
|
167 TPtr8* iSigningData; |
|
168 TBuf8<KKeyIdLen> iKeyId; |
|
169 TPtr8* iSignature; |
|
170 }; |
|
171 |
|
172 //Public key exportion struct |
|
173 struct TExportPublicKey |
|
174 { |
|
175 TPtr8* iPublicKey; |
|
176 TBuf8<KKeyIdLen> iKeyId; |
|
177 }; |
|
178 |
|
179 // struct for PIN state request |
|
180 struct TPINStateRequest |
|
181 { |
|
182 TBool iEnable; |
|
183 TBool iRetry; |
|
184 }; |
|
185 |
|
186 struct TOmaProv |
|
187 { |
|
188 TInt iSize; |
|
189 TInt iOmaType; |
|
190 TPtr8* iOmaData; |
|
191 }; |
|
192 |
|
193 struct TJavaProv |
|
194 { |
|
195 TBuf8<8>* iPath; |
|
196 TInt iSize; |
|
197 TPtr8* iJavaData; |
|
198 }; |
|
199 |
|
200 struct TTrustSettings |
|
201 { |
|
202 TBool iTrusted; |
|
203 TInt32 iUids[KMaxApplicationCount]; |
|
204 TInt iApplicationCount; |
|
205 }; |
|
206 |
|
207 #endif // __WIMCLSV_H__ |
|
208 |
|
209 // End of File |