|
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: Certificate & key -management class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 //INCLUDES |
|
20 #include "WimCertMgmt.h" |
|
21 #include "WimTrace.h" |
|
22 |
|
23 |
|
24 // ----------------------------------------------------------------------------- |
|
25 // RWimCertMgmt::RWimCertMgmt() |
|
26 // Default constructor |
|
27 // ----------------------------------------------------------------------------- |
|
28 // |
|
29 RWimCertMgmt::RWimCertMgmt(): iCertLst( NULL, 0, 0 ), iCertInfoLst( NULL, 0, 0 ) |
|
30 { |
|
31 iPckgBufAddCertsAllocated = EFalse; |
|
32 iPckgBufCertDetailsAllocated = EFalse; |
|
33 iPckgBufRemoveCertAllocated = EFalse; |
|
34 iPckgBufGetExtrasAllocated = EFalse; |
|
35 iPckgBufKeySignAllocated = EFalse; |
|
36 iPckgBufExportPublicKeyAllocated = EFalse; |
|
37 iPckgBufOmaProvAllocated = EFalse; |
|
38 iPckgBufJavaProvAllocated = EFalse; |
|
39 iAuthObjsInfoLstPtr = NULL; |
|
40 iAuthIdLstPtr = NULL; |
|
41 iPckgBufOmaProv = NULL; |
|
42 iPckgBufJavaProv = NULL; |
|
43 } |
|
44 |
|
45 |
|
46 // ----------------------------------------------------------------------------- |
|
47 // RWimCertMgmt::ClientSessionL() |
|
48 // Return new RWimCertMgmt object |
|
49 // ----------------------------------------------------------------------------- |
|
50 // |
|
51 RWimCertMgmt* RWimCertMgmt::ClientSessionL() |
|
52 { |
|
53 RWimCertMgmt* self = new( ELeave ) RWimCertMgmt; |
|
54 CleanupStack::PushL( self ); |
|
55 User::LeaveIfError( self->Connect() ); |
|
56 CleanupStack::Pop( self ); //self |
|
57 _WIMTRACE ( _L( "RWimCertMgmt::ClientSessionL()" ) ); |
|
58 return self; |
|
59 } |
|
60 |
|
61 // ----------------------------------------------------------------------------- |
|
62 // RWimCertMgmt::~RWimCertMgmt() |
|
63 // Destructor, all allocated memory is released. |
|
64 // ----------------------------------------------------------------------------- |
|
65 // |
|
66 RWimCertMgmt::~RWimCertMgmt() |
|
67 { |
|
68 _WIMTRACE ( _L( "RWimCertMgmt::~RWimCertMgmt()" ) ); |
|
69 iCertLst.Set( NULL, 0, 0 ); |
|
70 iCertInfoLst.Set( NULL, 0, 0 ); |
|
71 delete iAuthObjsInfoLstPtr; |
|
72 delete iAuthIdLstPtr; |
|
73 delete iPckgBufOmaProv; |
|
74 delete iPckgBufJavaProv; |
|
75 } |
|
76 |
|
77 |
|
78 |
|
79 /* Certificate management */ |
|
80 |
|
81 // ----------------------------------------------------------------------------- |
|
82 // RWimCertMgmt::CertCount() |
|
83 // Returns count of certificates |
|
84 // ----------------------------------------------------------------------------- |
|
85 // |
|
86 TUint8 RWimCertMgmt::CertCount( TWimEntryType aType ) |
|
87 { |
|
88 _WIMTRACE ( _L( "RWimCertMgmt::CertCount()" ) ); |
|
89 |
|
90 TPckgBuf<TUint8> pckg( 0 ); |
|
91 |
|
92 TIpcArgs args; |
|
93 args.Set( 0, &pckg ); |
|
94 args.Set( 1, aType ); |
|
95 |
|
96 SendReceiveData( EGetCertCount, args ); |
|
97 return pckg(); |
|
98 } |
|
99 |
|
100 // ----------------------------------------------------------------------------- |
|
101 // RWimCertMgmt::CertRefLst() |
|
102 // Returns certificate list on the WIM |
|
103 // ----------------------------------------------------------------------------- |
|
104 // |
|
105 void RWimCertMgmt::CertRefLst( TCertificateAddressList aCertAddrLst, |
|
106 TWimCertInfo* aCertInfoArr, |
|
107 TUint8 aCount, |
|
108 TWimEntryType aCertEntryType, |
|
109 TRequestStatus& aStatus ) |
|
110 { |
|
111 _WIMTRACE ( _L( "RWimCertMgmt::CertRefLst()" ) ); |
|
112 aStatus = KRequestPending; |
|
113 TInt16 size = ( TInt16 ) ( sizeof ( TCertificateAddress ) * aCount ); |
|
114 iCertLst.Set( ( TUint8* ) aCertAddrLst, size, size ); |
|
115 |
|
116 size = ( TInt16 )( sizeof ( TWimCertInfo ) * aCount ); |
|
117 iCertInfoLst.Set( ( TUint8* ) aCertInfoArr, size, size ); |
|
118 |
|
119 TIpcArgs args; |
|
120 args.Set( 0, &iCertLst ); |
|
121 args.Set( 1, &iCertInfoLst ); |
|
122 args.Set( 2, aCertEntryType ); |
|
123 |
|
124 SendReceiveData( EGetWIMCertLst, args, aStatus ); |
|
125 } |
|
126 |
|
127 // ----------------------------------------------------------------------------- |
|
128 // RWimCertMgmt::CertRefLst() |
|
129 // Returns certificate list on the WIM |
|
130 // ----------------------------------------------------------------------------- |
|
131 // |
|
132 TInt RWimCertMgmt::CertRefLst( TCertificateAddressList aCertAddrLst, |
|
133 TWimCertInfo* aCertInfoArr, |
|
134 TUint8 aCount, |
|
135 TWimEntryType aCertEntryType ) |
|
136 { |
|
137 _WIMTRACE ( _L( "RWimCertMgmt::CertRefLst()" ) ); |
|
138 TInt16 size = ( TInt16 ) ( sizeof ( TCertificateAddress ) * aCount ); |
|
139 iCertLst.Set( ( TUint8* ) aCertAddrLst, size, size ); |
|
140 |
|
141 size = ( TInt16 )( sizeof ( TWimCertInfo ) * aCount ); |
|
142 iCertInfoLst.Set( ( TUint8* ) aCertInfoArr, size, size ); |
|
143 |
|
144 TIpcArgs args; |
|
145 args.Set( 0, &iCertLst ); |
|
146 args.Set( 1, &iCertInfoLst ); |
|
147 args.Set( 2, aCertEntryType ); |
|
148 |
|
149 |
|
150 return SendReceiveData( EGetWIMCertLst, args ); |
|
151 } |
|
152 |
|
153 // ----------------------------------------------------------------------------- |
|
154 // RWimCertMgmt::CertDetailsL() |
|
155 // Returns certificate details. |
|
156 // ----------------------------------------------------------------------------- |
|
157 // |
|
158 void RWimCertMgmt::CertDetailsL( const TCertificateAddress aCertAddr, |
|
159 TWimCertDetails& aWimCertDetails, |
|
160 TRequestStatus& aStatus ) |
|
161 { |
|
162 _WIMTRACE ( _L( "RWimCertMgmt::CertDetailsL()" ) ); |
|
163 aStatus = KRequestPending; |
|
164 |
|
165 iPckgBufCertDetails = new( ELeave ) |
|
166 CWimCertPckgBuf<TWimCertDetails>( aWimCertDetails ); |
|
167 iPckgBufCertDetailsAllocated = ETrue; |
|
168 |
|
169 TIpcArgs args; |
|
170 args.Set( 0, aCertAddr ); |
|
171 args.Set( 1, iPckgBufCertDetails->PckgBuf() ); |
|
172 args.Set( 2, aWimCertDetails.iCert ); |
|
173 |
|
174 SendReceiveData( EGetWIMCertDetails, args, aStatus ); |
|
175 } |
|
176 |
|
177 |
|
178 // ----------------------------------------------------------------------------- |
|
179 // RWimCertMgmt::StoreCertificateL() |
|
180 // Stores the certificate to WIM |
|
181 // ----------------------------------------------------------------------------- |
|
182 // |
|
183 void RWimCertMgmt::StoreCertificateL( const TDes8& aCertificate, |
|
184 TWimCertAddParameters& aParams, |
|
185 TWimCertLocation aLocation, |
|
186 TRequestStatus& aStatus ) |
|
187 { |
|
188 _WIMTRACE ( _L( "RWimCertMgmt::StoreCertificateL()" ) ); |
|
189 aStatus = KRequestPending; |
|
190 |
|
191 iPckgBufAddCerts = new( ELeave ) |
|
192 CWimCertPckgBuf<TWimCertAddParameters>( aParams ); |
|
193 iPckgBufAddCertsAllocated = ETrue; |
|
194 |
|
195 TIpcArgs args; |
|
196 args.Set( 0, &aCertificate ); |
|
197 args.Set( 1, iPckgBufAddCerts->PckgBuf() ); |
|
198 args.Set( 2, aLocation ); |
|
199 |
|
200 |
|
201 SendReceiveData( EStoreCertificate, args, aStatus ); |
|
202 } |
|
203 |
|
204 // ----------------------------------------------------------------------------- |
|
205 // RWimCertMgmt::GetCertExtrasL() |
|
206 // Gets certificate extra data from one certificate |
|
207 // ----------------------------------------------------------------------------- |
|
208 // |
|
209 void RWimCertMgmt::GetCertExtrasL( const TPtr8* aKeyId, |
|
210 TCertExtrasInfo& aCertExtrasInfo, |
|
211 TUint aUsage, |
|
212 TRequestStatus& aStatus ) |
|
213 { |
|
214 _WIMTRACE ( _L( "RWimCertMgmt::GetCertExtrasL()" ) ); |
|
215 aStatus = KRequestPending; |
|
216 iPckgBufGetExtras = new( ELeave ) |
|
217 CWimCertPckgBuf<TCertExtrasInfo>( aCertExtrasInfo ); |
|
218 iPckgBufGetExtrasAllocated = ETrue; |
|
219 |
|
220 TIpcArgs args; |
|
221 args.Set( 0, aKeyId ); |
|
222 args.Set( 1, iPckgBufGetExtras->PckgBuf() ); |
|
223 args.Set( 2, aUsage ); |
|
224 args.Set( 3, aCertExtrasInfo.iTrustedUsage ); |
|
225 |
|
226 SendReceiveData( EGetCertExtras, args, aStatus ); |
|
227 } |
|
228 |
|
229 |
|
230 // ----------------------------------------------------------------------------- |
|
231 // RWimCertMgmt::CertExtrasPckgBuf() |
|
232 // Returns CWimCertPckgBuf<TCertExtrasInfo>* member variable. |
|
233 // ----------------------------------------------------------------------------- |
|
234 // |
|
235 CWimCertPckgBuf<TCertExtrasInfo>* RWimCertMgmt::CertExtrasPckgBuf() |
|
236 { |
|
237 _WIMTRACE ( _L( "RWimCertMgmt::CertExtrasPckgBuf()" ) ); |
|
238 return iPckgBufGetExtras; |
|
239 } |
|
240 |
|
241 // ----------------------------------------------------------------------------- |
|
242 // RWimCertMgmt::RemoveL() |
|
243 // Removes a certificate from WIM |
|
244 // ----------------------------------------------------------------------------- |
|
245 // |
|
246 void RWimCertMgmt::RemoveL( TWimCertRemoveAddr aWimCertRemoveAddr, |
|
247 TRequestStatus& aStatus ) |
|
248 { |
|
249 _WIMTRACE ( _L( "RWimCertMgmt::RemoveL()" ) ); |
|
250 aStatus = KRequestPending; |
|
251 iPckgBufRemoveCert = new( ELeave ) |
|
252 CWimCertPckgBuf<TWimCertRemoveAddr>( aWimCertRemoveAddr ); |
|
253 iPckgBufRemoveCertAllocated = ETrue; |
|
254 |
|
255 TIpcArgs args; |
|
256 args.Set( 0, iPckgBufRemoveCert->PckgBuf() ); |
|
257 |
|
258 SendReceiveData( ERemoveCertificate, args, aStatus ); |
|
259 } |
|
260 |
|
261 |
|
262 // ----------------------------------------------------------------------------- |
|
263 // RWimCertMgmt::DeallocWimCertPckgBuf() |
|
264 // DeAllocates memory from iPckgBufCertDetails. |
|
265 // ----------------------------------------------------------------------------- |
|
266 // |
|
267 void RWimCertMgmt::DeallocWimCertPckgBuf() |
|
268 { |
|
269 _WIMTRACE ( _L( "RWimCertMgmt::DeallocWimCertPckgBuf()" ) ); |
|
270 if ( iPckgBufCertDetailsAllocated ) |
|
271 { |
|
272 delete iPckgBufCertDetails; |
|
273 iPckgBufCertDetails = NULL; |
|
274 iPckgBufCertDetailsAllocated = EFalse; |
|
275 } |
|
276 } |
|
277 |
|
278 // ----------------------------------------------------------------------------- |
|
279 // RWimCertMgmt::DeallocCertAddParametersPckgBuf() |
|
280 // DeAllocates memory from iPckgBufAddCerts. |
|
281 // ----------------------------------------------------------------------------- |
|
282 // |
|
283 void RWimCertMgmt::DeallocCertAddParametersPckgBuf() |
|
284 { |
|
285 _WIMTRACE ( _L( "RWimCertMgmt::DeallocCertAddParametersPckgBuf()" ) ); |
|
286 if ( iPckgBufAddCertsAllocated ) |
|
287 { |
|
288 delete iPckgBufAddCerts; |
|
289 iPckgBufAddCerts = NULL; |
|
290 iPckgBufAddCertsAllocated = EFalse; |
|
291 } |
|
292 } |
|
293 |
|
294 |
|
295 // ----------------------------------------------------------------------------- |
|
296 // RWimCertMgmt::DeallocRemoveCertPckgBuf() |
|
297 // DeAllocates memory from iPckgBufRemoveCert. |
|
298 // ----------------------------------------------------------------------------- |
|
299 // |
|
300 void RWimCertMgmt::DeallocRemoveCertPckgBuf() |
|
301 { |
|
302 _WIMTRACE ( _L( "RWimCertMgmt::DeallocRemoveCertPckgBuf()" ) ); |
|
303 if ( iPckgBufRemoveCertAllocated ) |
|
304 { |
|
305 delete iPckgBufRemoveCert; |
|
306 iPckgBufRemoveCert = NULL; |
|
307 iPckgBufRemoveCertAllocated = EFalse; |
|
308 } |
|
309 } |
|
310 |
|
311 |
|
312 // ----------------------------------------------------------------------------- |
|
313 // RWimCertMgmt::DeallocGetExtrasPckgBuf() |
|
314 // DeAllocates memory from iPckgBufGetExtras. |
|
315 // ----------------------------------------------------------------------------- |
|
316 // |
|
317 void RWimCertMgmt::DeallocGetExtrasPckgBuf() |
|
318 { |
|
319 _WIMTRACE ( _L( "RWimCertMgmt::DeallocGetExtrasPckgBuf()" ) ); |
|
320 if ( iPckgBufGetExtrasAllocated ) |
|
321 { |
|
322 delete iPckgBufGetExtras; |
|
323 iPckgBufGetExtras = NULL; |
|
324 iPckgBufGetExtrasAllocated = EFalse; |
|
325 } |
|
326 } |
|
327 |
|
328 |
|
329 |
|
330 |
|
331 /* Key Management */ |
|
332 |
|
333 // ----------------------------------------------------------------------------- |
|
334 // RWimCertMgmt::KeyList() |
|
335 // |
|
336 // Gets the KeyList from the WIM |
|
337 // ----------------------------------------------------------------------------- |
|
338 // |
|
339 void RWimCertMgmt::KeyList( TDes8& aKeyList, |
|
340 TDes8& aKeyCountPkg, |
|
341 TRequestStatus& aStatus ) |
|
342 { |
|
343 _WIMTRACE ( _L( "RWimCertMgmt::KeyList()" ) ); |
|
344 aStatus = KRequestPending; |
|
345 |
|
346 TIpcArgs args; |
|
347 args.Set( 0, &aKeyList ); |
|
348 args.Set( 1, &aKeyCountPkg ); |
|
349 |
|
350 |
|
351 SendReceiveData( EGetKeyList, args, aStatus ); |
|
352 } |
|
353 |
|
354 // ----------------------------------------------------------------------------- |
|
355 // RWimCertMgmt::GetKeyInfo() |
|
356 // |
|
357 // Gets Info for single key |
|
358 // ----------------------------------------------------------------------------- |
|
359 // |
|
360 TInt RWimCertMgmt::GetKeyInfo( const TInt32 aKeyReference, |
|
361 TKeyInfo& aKeyInfo ) |
|
362 { |
|
363 _WIMTRACE ( _L( "RWimCertMgmt::GetKeyInfo()" ) ); |
|
364 TPckg<TKeyInfo> keyinfo ( aKeyInfo ); |
|
365 |
|
366 TIpcArgs args; |
|
367 args.Set( 0, aKeyReference ); |
|
368 args.Set( 1, &keyinfo ); |
|
369 |
|
370 return SendReceiveData( EGetKeyDetails, args ); |
|
371 } |
|
372 |
|
373 // ----------------------------------------------------------------------------- |
|
374 // RWimCertMgmt::SignL() |
|
375 // Sign some data |
|
376 // ----------------------------------------------------------------------------- |
|
377 // |
|
378 void RWimCertMgmt::SignL( TKeySignParameters& aSignParameters, |
|
379 TRequestStatus& aStatus ) |
|
380 { |
|
381 _WIMTRACE ( _L( "RWimCertMgmt::SignL" ) ); |
|
382 aStatus = KRequestPending; |
|
383 iPckgBufKeySignParameters = new( ELeave ) |
|
384 CWimCertPckgBuf<TKeySignParameters>( aSignParameters ); |
|
385 iPckgBufKeySignAllocated = ETrue; |
|
386 |
|
387 TIpcArgs args; |
|
388 args.Set( 1, iPckgBufKeySignParameters->PckgBuf() ); |
|
389 args.Set( 2, aSignParameters.iSigningData ); |
|
390 args.Set( 3, aSignParameters.iSignature ); |
|
391 |
|
392 SendReceiveData( ESignTextReq, args, aStatus ); |
|
393 } |
|
394 |
|
395 // ----------------------------------------------------------------------------- |
|
396 // RWimCertMgmt::DeallocKeySignPckgBuf() |
|
397 // Deallocates member variable |
|
398 // ----------------------------------------------------------------------------- |
|
399 // |
|
400 void RWimCertMgmt::DeallocKeySignPckgBuf() |
|
401 { |
|
402 _WIMTRACE ( _L( "RWimCertMgmt::DeallocKeySignPckgBuf" ) ); |
|
403 if ( iPckgBufKeySignAllocated ) |
|
404 { |
|
405 delete iPckgBufKeySignParameters; |
|
406 iPckgBufKeySignParameters = NULL; |
|
407 iPckgBufKeySignAllocated = EFalse; |
|
408 } |
|
409 } |
|
410 |
|
411 // ----------------------------------------------------------------------------- |
|
412 // RWimCertMgmt::ExportPublicKeyL() |
|
413 // Export public key |
|
414 // ----------------------------------------------------------------------------- |
|
415 // |
|
416 void RWimCertMgmt::ExportPublicKeyL( TExportPublicKey& aPublicKeyParams, |
|
417 TRequestStatus& aStatus ) |
|
418 { |
|
419 _WIMTRACE ( _L( "RWimCertMgmt::ExportPublicKeyL" ) ); |
|
420 aStatus = KRequestPending; |
|
421 iPckgBufExportPublicKey = new( ELeave ) |
|
422 CWimCertPckgBuf<TExportPublicKey>( aPublicKeyParams ); |
|
423 iPckgBufExportPublicKeyAllocated = ETrue; |
|
424 |
|
425 TIpcArgs args; |
|
426 args.Set( 0, iPckgBufExportPublicKey->PckgBuf() ); |
|
427 args.Set( 1, aPublicKeyParams.iPublicKey ); |
|
428 |
|
429 SendReceiveData( EExportPublicKey, args, aStatus ); |
|
430 } |
|
431 |
|
432 // ----------------------------------------------------------------------------- |
|
433 // RWimCertMgmt::DeallocExportPublicKeyPckgBuf() |
|
434 // Deallocates member variable. |
|
435 // ----------------------------------------------------------------------------- |
|
436 // |
|
437 void RWimCertMgmt::DeallocExportPublicKeyPckgBuf() |
|
438 { |
|
439 _WIMTRACE ( _L( "RWimCertMgmt::DeallocExportPublicKeyPckgBuf" ) ); |
|
440 if ( iPckgBufExportPublicKey ) |
|
441 { |
|
442 delete iPckgBufExportPublicKey; |
|
443 iPckgBufExportPublicKey = NULL; |
|
444 iPckgBufExportPublicKeyAllocated = EFalse; |
|
445 } |
|
446 } |
|
447 |
|
448 |
|
449 |
|
450 /* OMA Provisioning */ |
|
451 |
|
452 // ----------------------------------------------------------------------------- |
|
453 // RWimCertMgmt::RetrieveOmaDataL() |
|
454 // Retrieves OMA provisioning data. |
|
455 // ----------------------------------------------------------------------------- |
|
456 // |
|
457 void RWimCertMgmt::RetrieveOmaDataL( TOmaProv& aOmaProvStruct, |
|
458 TRequestStatus& aStatus, |
|
459 const TWimServRqst aOpCode ) |
|
460 { |
|
461 _WIMTRACE ( _L( "RWimCertMgmt::RetrieveOmaDataL" ) ); |
|
462 aStatus = KRequestPending; |
|
463 iPckgBufOmaProv = new( ELeave ) |
|
464 CWimCertPckgBuf<TOmaProv>( aOmaProvStruct ); |
|
465 iPckgBufOmaProvAllocated = ETrue; |
|
466 |
|
467 TIpcArgs args; |
|
468 args.Set( 0, iPckgBufOmaProv->PckgBuf() ); |
|
469 args.Set( 1, aOmaProvStruct.iOmaData ); |
|
470 |
|
471 SendReceiveData( aOpCode, args, aStatus ); |
|
472 } |
|
473 |
|
474 // ----------------------------------------------------------------------------- |
|
475 // RWimCertMgmt::RetrieveACIFDataL() |
|
476 // Retrieves ACIF data. |
|
477 // ----------------------------------------------------------------------------- |
|
478 // |
|
479 void RWimCertMgmt::RetrieveACIFDataL( TJavaProv& aJavaProvStruct, |
|
480 TRequestStatus& aStatus, |
|
481 const TWimServRqst aOpCode ) |
|
482 { |
|
483 _WIMTRACE ( _L( "RWimCertMgmt::RetrieveACIFDataL" ) ); |
|
484 aStatus = KRequestPending; |
|
485 iPckgBufJavaProv = new( ELeave ) |
|
486 CWimCertPckgBuf<TJavaProv>( aJavaProvStruct ); |
|
487 iPckgBufJavaProvAllocated = ETrue; |
|
488 |
|
489 TIpcArgs args; |
|
490 args.Set( 0, iPckgBufJavaProv->PckgBuf() ); |
|
491 args.Set( 1, aJavaProvStruct.iJavaData ); |
|
492 |
|
493 SendReceiveData( aOpCode, args, aStatus ); |
|
494 } |
|
495 |
|
496 // ----------------------------------------------------------------------------- |
|
497 // RWimCertMgmt::RetrieveACFDataL() |
|
498 // Retrieves ACF data. |
|
499 // ----------------------------------------------------------------------------- |
|
500 // |
|
501 void RWimCertMgmt::RetrieveACFDataL( TJavaProv& aJavaProvStruct, |
|
502 TRequestStatus& aStatus, |
|
503 const TWimServRqst aOpCode ) |
|
504 { |
|
505 _WIMTRACE ( _L( "RWimCertMgmt::RetrieveACFDataL" ) ); |
|
506 aStatus = KRequestPending; |
|
507 iPckgBufJavaProv = new( ELeave ) |
|
508 CWimCertPckgBuf<TJavaProv>( aJavaProvStruct ); |
|
509 iPckgBufJavaProvAllocated = ETrue; |
|
510 |
|
511 TIpcArgs args; |
|
512 args.Set( 0, iPckgBufJavaProv->PckgBuf() ); |
|
513 args.Set( 1, aJavaProvStruct.iJavaData ); |
|
514 args.Set( 2, aJavaProvStruct.iPath ); |
|
515 |
|
516 SendReceiveData( aOpCode, args, aStatus ); |
|
517 } |
|
518 |
|
519 // ----------------------------------------------------------------------------- |
|
520 // RWimCertMgmt::GetAuthObjsInfo() |
|
521 // Get Authentication Object information |
|
522 // ----------------------------------------------------------------------------- |
|
523 // |
|
524 void RWimCertMgmt::RetrieveAuthObjsInfoL( const RArray<TInt>& aAuthIdList, |
|
525 RArray<TJavaPINParams>& aAuthObjsInfoList, |
|
526 TRequestStatus& aStatus, |
|
527 const TWimServRqst aOpCode ) |
|
528 { |
|
529 _WIMTRACE ( _L( "RWimCertMgmt::RetrieveAuthObjsInfo" ) ); |
|
530 |
|
531 TInt count = aAuthIdList.Count(); |
|
532 TInt authIdLength = count * sizeof( TInt ); |
|
533 TInt authobjLength = count * sizeof( TJavaPINParams ); |
|
534 |
|
535 if ( iAuthIdLstPtr == NULL ) |
|
536 { |
|
537 iAuthIdLstPtr = new( ELeave )TPtrC8( (TText8*)&aAuthIdList[0], authIdLength ); |
|
538 } |
|
539 else |
|
540 { |
|
541 iAuthIdLstPtr->Set( (TText8*)&aAuthIdList[0], authIdLength ); |
|
542 } |
|
543 |
|
544 if ( iAuthObjsInfoLstPtr == NULL ) |
|
545 { |
|
546 iAuthObjsInfoLstPtr = new( ELeave )TPtr8( (TText8*)&aAuthObjsInfoList[0], authobjLength, authobjLength ); |
|
547 } |
|
548 else |
|
549 { |
|
550 iAuthObjsInfoLstPtr->Set( (TText8*)&aAuthObjsInfoList[0], authobjLength, authobjLength ); |
|
551 } |
|
552 |
|
553 aStatus = KRequestPending; |
|
554 TIpcArgs args; |
|
555 |
|
556 args.Set( 0, iAuthIdLstPtr ); |
|
557 args.Set( 1, iAuthObjsInfoLstPtr ); |
|
558 args.Set( 2, count ); |
|
559 |
|
560 |
|
561 SendReceiveData( aOpCode, args, aStatus ); |
|
562 } |
|
563 |
|
564 |
|
565 // ----------------------------------------------------------------------------- |
|
566 // RWimCertMgmt::RetrieveLabelAndPathL() |
|
567 // Get Authentication Object information |
|
568 // ----------------------------------------------------------------------------- |
|
569 // |
|
570 void RWimCertMgmt::RetrieveLabelAndPathL( TDes8& aLabel, |
|
571 TDes8& aPath, |
|
572 TRequestStatus& aStatus, |
|
573 const TWimServRqst aOpCode ) |
|
574 { |
|
575 aStatus = KRequestPending; |
|
576 TIpcArgs args; |
|
577 |
|
578 args.Set( 0, &aLabel ); |
|
579 args.Set( 1, &aPath ); |
|
580 |
|
581 SendReceiveData( aOpCode, args, aStatus ); |
|
582 } |
|
583 // ----------------------------------------------------------------------------- |
|
584 // RWimCertMgmt::TOmaProvPckgBuf() |
|
585 // Returns member variable. |
|
586 // ----------------------------------------------------------------------------- |
|
587 // |
|
588 CWimCertPckgBuf<TOmaProv>* RWimCertMgmt::TOmaProvPckgBuf() |
|
589 { |
|
590 return iPckgBufOmaProv; |
|
591 } |
|
592 |
|
593 // ----------------------------------------------------------------------------- |
|
594 // RWimCertMgmt::TJavaProvPckgBuf() |
|
595 // Returns member variable. |
|
596 // ----------------------------------------------------------------------------- |
|
597 // |
|
598 CWimCertPckgBuf<TJavaProv>* RWimCertMgmt::TJavaProvPckgBuf() |
|
599 { |
|
600 return iPckgBufJavaProv; |
|
601 } |
|
602 |
|
603 // ----------------------------------------------------------------------------- |
|
604 // RWimCertMgmt::DeallocOmaDataPckgBuf() |
|
605 // Deallocates member variable. |
|
606 // ----------------------------------------------------------------------------- |
|
607 // |
|
608 void RWimCertMgmt::DeallocOmaDataPckgBuf() |
|
609 { |
|
610 if ( iPckgBufOmaProvAllocated ) |
|
611 { |
|
612 delete iPckgBufOmaProv; |
|
613 iPckgBufOmaProv = NULL; |
|
614 iPckgBufOmaProvAllocated = EFalse; |
|
615 } |
|
616 } |
|
617 |
|
618 // ----------------------------------------------------------------------------- |
|
619 // RWimCertMgmt::DeallocJavaDataPckgBuf() |
|
620 // Deallocates member variable. |
|
621 // ----------------------------------------------------------------------------- |
|
622 // |
|
623 void RWimCertMgmt::DeallocJavaDataPckgBuf() |
|
624 { |
|
625 if ( iPckgBufJavaProvAllocated ) |
|
626 { |
|
627 delete iPckgBufJavaProv; |
|
628 iPckgBufJavaProv = NULL; |
|
629 iPckgBufJavaProvAllocated = EFalse; |
|
630 } |
|
631 } |