8 * |
8 * |
9 * Initial Contributors: |
9 * Initial Contributors: |
10 * Pritam Roy Biswas, Sasken Communication Technologies Ltd - Initial contribution |
10 * Pritam Roy Biswas, Sasken Communication Technologies Ltd - Initial contribution |
11 * |
11 * |
12 * Description: |
12 * Description: |
13 * This header file gives different data classes to be used |
13 * This header file gives different data classes to be used |
14 * by Credential Manager Client and Server for data transfer. |
14 * by Smf Credential Manager Client and Server for data transfer. |
15 * |
15 * |
16 */ |
16 */ |
|
17 |
17 #ifndef CSMFCREDMGRCLIENTDATASTRUCT_H_ |
18 #ifndef CSMFCREDMGRCLIENTDATASTRUCT_H_ |
18 #define CSMFCREDMGRCLIENTDATASTRUCT_H_ |
19 #define CSMFCREDMGRCLIENTDATASTRUCT_H_ |
19 |
20 |
20 // System includes |
21 // System includes |
21 #include <e32cmn.h> |
22 #include <e32cmn.h> |
51 |
52 |
52 /** |
53 /** |
53 * Maximum Length for SignedMessage |
54 * Maximum Length for SignedMessage |
54 */ |
55 */ |
55 const TInt KMaxSignedMsgLength = 256; |
56 const TInt KMaxSignedMsgLength = 256; |
|
57 |
|
58 |
56 /** |
59 /** |
57 * This class provide details and to serialize Authentication Key And Secret |
60 * This class provide details and to serialize Authentication Key And Secret |
58 */ |
61 */ |
59 class TSmfAuthToken |
62 class TSmfAuthToken |
60 { |
63 { |
61 public: |
64 public: |
62 /** |
65 /** |
63 * constructor |
66 * Constructor |
64 */ |
67 */ |
65 inline TSmfAuthToken() : |
68 inline TSmfAuthToken() : |
66 iKey(NULL), iSecret(NULL) |
69 iKey(NULL), iSecret(NULL) |
67 { |
70 { |
68 } |
71 } |
|
72 |
69 /** |
73 /** |
70 * Method to externalize the member variables |
74 * Method to externalize the member variables |
71 * @param aStream The Write Stream to be filled. |
75 * @param aStream The Write Stream to be filled. |
72 */ |
76 */ |
73 void ExternalizeL(RWriteStream& aStream); |
77 void ExternalizeL(RWriteStream& aStream); |
77 * @param aStream the stream to read from |
81 * @param aStream the stream to read from |
78 */ |
82 */ |
79 void InternalizeL(RReadStream& aStream); |
83 void InternalizeL(RReadStream& aStream); |
80 |
84 |
81 /** |
85 /** |
82 * buf to hold the key |
86 * Buffer to hold the key |
83 */ |
87 */ |
84 HBufC* iKey; |
88 HBufC* iKey; |
85 /** |
89 |
86 * buf to hold the secret |
90 /** |
|
91 * Buffer to hold the secret |
87 */ |
92 */ |
88 HBufC* iSecret; |
93 HBufC* iSecret; |
89 }; |
94 }; |
90 |
95 |
|
96 |
91 /** |
97 /** |
92 * This class provide details and to serialize for the API fetching Authentication Parameters |
98 * This class provide details and to serialize for the API fetching Authentication Parameters |
93 */ |
99 */ |
94 class CSmfFetchAuthTokenSet : public CBase |
100 class CSmfFetchAuthTokenSet : public CBase |
95 { |
101 { |
96 public: |
102 public: |
97 /** |
103 /** |
98 * destructor |
104 * Destructor |
99 */ |
105 */ |
100 ~CSmfFetchAuthTokenSet() |
106 ~CSmfFetchAuthTokenSet() |
101 { |
107 { |
102 iAuthTokenArray.Reset(); |
108 iAuthTokenArray.Reset(); |
103 delete iRegistrationToken; |
109 delete iRegistrationToken; |
109 */ |
115 */ |
110 void ExternalizeL(RWriteStream& aStream); |
116 void ExternalizeL(RWriteStream& aStream); |
111 |
117 |
112 /** |
118 /** |
113 * Method to internalize the member variables |
119 * Method to internalize the member variables |
114 * @param aSource the source to read from |
120 * @param aSource The Source Stream to read from |
115 */ |
121 */ |
116 void InternalizeL(const RBuf8& aSource); |
122 void InternalizeL(const RBuf8& aSource); |
117 /** |
123 |
118 * buf to hold registration token |
124 /** |
|
125 * Buffer to hold registration token |
119 */ |
126 */ |
120 HBufC* iRegistrationToken; |
127 HBufC* iRegistrationToken; |
|
128 |
121 /** |
129 /** |
122 * Time by which the Auth set will expire |
130 * Time by which the Auth set will expire |
123 */ |
131 */ |
124 TUint32 iValidity; |
132 TUint32 iValidity; |
125 /** |
133 |
126 * array in symbian to hold the key-value pair |
134 /** |
|
135 * Array in symbian to hold the key-value pair |
127 */ |
136 */ |
128 RArray<TSmfAuthToken> iAuthTokenArray; |
137 RArray<TSmfAuthToken> iAuthTokenArray; |
129 }; |
138 }; |
130 |
139 |
|
140 |
131 /** |
141 /** |
132 * This class provide details and to serialize of data to the API retreiving URL List |
142 * This class provide details and to serialize of data to the API retreiving URL List |
133 */ |
143 */ |
134 class CSmfURLListParams : public CBase |
144 class CSmfURLListParams : public CBase |
135 { |
145 { |
136 public: |
146 public: |
137 /** |
147 /** |
138 * destructor |
148 * Destructor |
139 */ |
149 */ |
140 ~CSmfURLListParams() |
150 ~CSmfURLListParams() |
141 { |
151 { |
142 iURLList.ResetAndDestroy(); |
152 iURLList.ResetAndDestroy(); |
143 delete iPluginID; |
153 delete iPluginID; |
149 */ |
159 */ |
150 void ExternalizeL(RWriteStream& aStream); |
160 void ExternalizeL(RWriteStream& aStream); |
151 |
161 |
152 /** |
162 /** |
153 * Method to internalize the member variables |
163 * Method to internalize the member variables |
154 * @param aSource the source to read from |
164 * @param aSource The source stream to read from |
155 */ |
165 */ |
156 void InternalizeL(const TDesC8& aSource); |
166 void InternalizeL(const TDesC8& aSource); |
157 |
167 |
158 /** |
168 /** |
159 * array in symbian to hold url list |
169 * Array in symbian to hold url list |
160 */ |
170 */ |
161 RPointerArray<HBufC> iURLList; |
171 RPointerArray<HBufC> iURLList; |
162 |
172 |
163 /** |
173 /** |
164 * buf to hold the plugin id for which urls will be queried |
174 * Buffer to hold the plugin id for which urls will be queried |
165 */ |
175 */ |
166 HBufC* iPluginID; |
176 HBufC* iPluginID; |
167 }; |
177 }; |
168 |
178 |
|
179 |
169 /** |
180 /** |
170 * This class provide details and to serialize data to the API retreiving Authenticated PluginID List |
181 * This class provide details and to serialize data to the API retreiving Authenticated PluginID List |
171 */ |
182 */ |
172 class CSmfPluginIDListParams : public CBase |
183 class CSmfPluginIDListParams : public CBase |
173 { |
184 { |
174 public: |
185 public: |
175 /** |
186 /** |
176 * destructor |
187 * Destructor |
177 */ |
188 */ |
178 ~CSmfPluginIDListParams() |
189 ~CSmfPluginIDListParams() |
179 { |
190 { |
180 iPluginList.ResetAndDestroy(); |
191 iPluginList.ResetAndDestroy(); |
181 delete iRegistrationToken; |
192 delete iRegistrationToken; |
187 */ |
198 */ |
188 void ExternalizeL(RWriteStream& aStream); |
199 void ExternalizeL(RWriteStream& aStream); |
189 |
200 |
190 /** |
201 /** |
191 * Method to internalize the member variables |
202 * Method to internalize the member variables |
192 * @param aSource the source to read from |
203 * @param aSource The source stream to read from |
193 */ |
204 */ |
194 void InternalizeL(const RBuf8& aSource); |
205 void InternalizeL(const RBuf8& aSource); |
195 /** |
206 |
196 * array in symbian to hold plugin list |
207 /** |
|
208 * Array in symbian to hold plugin list |
197 */ |
209 */ |
198 RPointerArray<HBufC> iPluginList; |
210 RPointerArray<HBufC> iPluginList; |
199 /** |
211 |
200 * buf to hold registration token for which the list of plugins will be queried |
212 /** |
|
213 * Buffer to hold registration token for which the list of plugins will be queried |
201 */ |
214 */ |
202 HBufC* iRegistrationToken; |
215 HBufC* iRegistrationToken; |
203 }; |
216 }; |
204 |
217 |
205 /** |
218 /** |
226 */ |
239 */ |
227 void ExternalizeL(RWriteStream& aStream); |
240 void ExternalizeL(RWriteStream& aStream); |
228 |
241 |
229 /** |
242 /** |
230 * Method to internalize the member variables |
243 * Method to internalize the member variables |
231 * @param aSource the source to read from |
244 * @param aSource The source stream to read from |
232 */ |
245 */ |
233 void InternalizeL(const RBuf8& aSource); |
246 void InternalizeL(const RBuf8& aSource); |
234 /** |
247 |
235 * array to hold TSmfAuthToken elements |
248 /** |
|
249 * Array to hold TSmfAuthToken elements |
236 */ |
250 */ |
237 RArray<TSmfAuthToken> iAuthTokenArray; |
251 RArray<TSmfAuthToken> iAuthTokenArray; |
238 /** |
252 |
239 * array to hold list of plugins |
253 /** |
|
254 * Array to hold list of plugins |
240 */ |
255 */ |
241 RPointerArray<HBufC> iPluginIDList; |
256 RPointerArray<HBufC> iPluginIDList; |
242 /** |
257 |
243 * array to hold URl list |
258 /** |
|
259 * Array to hold URL list |
244 */ |
260 */ |
245 RPointerArray<HBufC> iURLList; |
261 RPointerArray<HBufC> iURLList; |
246 /** |
262 |
247 * buf to hold the registration token |
263 /** |
|
264 * Buffer to hold the registration token |
248 */ |
265 */ |
249 HBufC* iRegistrationToken; |
266 HBufC* iRegistrationToken; |
250 /** |
267 |
251 * buf to hold the authentication application ID |
268 /** |
|
269 * Buffer to hold the authentication application ID |
252 */ |
270 */ |
253 HBufC* iAuthAppID; |
271 HBufC* iAuthAppID; |
254 /** |
272 |
255 * flag to indicate an enabled pluginID |
273 /** |
|
274 * Flag to indicate an enabled pluginID |
256 */ |
275 */ |
257 TBool pluginIDEnabled; |
276 TBool pluginIDEnabled; |
|
277 |
258 /** |
278 /** |
259 * Time by which the Auth set will expire |
279 * Time by which the Auth set will expire |
260 */ |
280 */ |
261 TUint32 iValidity; |
281 TUint32 iValidity; |
262 }; |
282 }; |
280 */ |
300 */ |
281 void ExternalizeL(RWriteStream& aStream); |
301 void ExternalizeL(RWriteStream& aStream); |
282 |
302 |
283 /** |
303 /** |
284 * Method to internalize the member variables |
304 * Method to internalize the member variables |
285 * @param aSource the source to read from |
305 * @param aSource The source stream to read from |
286 */ |
306 */ |
287 void InternalizeL(const RBuf8& aSource); |
307 void InternalizeL(const RBuf8& aSource); |
288 |
308 |
289 /** |
309 /** |
290 * Id of new plugin |
310 * Id of new plugin |
291 */ |
311 */ |
292 HBufC* iNewPluginID; |
312 HBufC* iNewPluginID; |
|
313 |
293 /** |
314 /** |
294 * Id of the old plugin to be replaced |
315 * Id of the old plugin to be replaced |
295 */ |
316 */ |
296 HBufC* iOldPluginID; |
317 HBufC* iOldPluginID; |
|
318 |
297 /** |
319 /** |
298 * flag to indicate an enabled pluginID |
320 * flag to indicate an enabled pluginID |
299 */ |
321 */ |
300 TBool pluginIDEnabled; |
322 TBool pluginIDEnabled; |
301 }; |
323 }; |
305 */ |
327 */ |
306 class CSmfSignParameters : public CBase |
328 class CSmfSignParameters : public CBase |
307 { |
329 { |
308 public: |
330 public: |
309 /** |
331 /** |
310 * New Functions |
332 * NewL method |
|
333 * @param aMessage The message to be signed |
|
334 * @param aKey The key |
|
335 * @return The constructed CSmfSignParameters instance |
311 */ |
336 */ |
312 static CSmfSignParameters* NewL( const TDesC8& aMessage, const TDesC8& aKey ); |
337 static CSmfSignParameters* NewL( const TDesC8& aMessage, const TDesC8& aKey ); |
|
338 |
|
339 /** |
|
340 * Overloaded NewL method |
|
341 * @param aMessage The message to be signed |
|
342 * @return The constructed CSmfSignParameters instance |
|
343 */ |
313 static CSmfSignParameters* NewL( const TDesC8& aData ); |
344 static CSmfSignParameters* NewL( const TDesC8& aData ); |
|
345 |
314 /** |
346 /** |
315 * Destructor |
347 * Destructor |
316 */ |
348 */ |
317 ~CSmfSignParameters(); |
349 ~CSmfSignParameters(); |
|
350 |
318 /** |
351 /** |
319 * Method to externalize the member variables |
352 * Method to externalize the member variables |
320 * @param aStream The Write Stream to be filled. |
353 * @param aStream The Write Stream to be filled. |
321 */ |
354 */ |
322 void ExternalizeL( RWriteStream& aStream ) const; |
355 void ExternalizeL( RWriteStream& aStream ) const; |
323 /** |
356 |
324 * Get Method for key. |
357 /** |
|
358 * Method to get the Key for the signature |
|
359 * @return The Key for the signature |
325 */ |
360 */ |
326 const TDesC8& Key() const; |
361 const TDesC8& Key() const; |
327 /** |
362 |
328 * Get Method for message. |
363 /** |
|
364 * Method to get the message |
|
365 * @return The message |
329 */ |
366 */ |
330 const TDesC8& Message() const; |
367 const TDesC8& Message() const; |
331 |
368 |
332 private: |
369 private: |
333 /** |
370 /** |
334 * Constructor |
371 * Constructor |
335 */ |
372 */ |
336 CSmfSignParameters(); |
373 CSmfSignParameters(); |
337 /** |
374 |
338 * Two Phase constructors |
375 /** |
|
376 * Two Phase constructor |
|
377 * @param aKey The Key for the signature |
|
378 * @return The constructed CSmfSignParameters instance |
339 */ |
379 */ |
340 void ConstructL( const TDesC8& aMessage, const TDesC8& aKey ); |
380 void ConstructL( const TDesC8& aMessage, const TDesC8& aKey ); |
|
381 |
|
382 /** |
|
383 * Two Phase constructor |
|
384 * @return The constructed CSmfSignParameters instance |
|
385 */ |
341 void ConstructL( const TDesC8& aData ); |
386 void ConstructL( const TDesC8& aData ); |
342 |
387 |
343 private: |
388 private: |
344 /** |
389 /** |
345 * Message to sign |
390 * Message to be signed |
346 */ |
391 */ |
347 RBuf8 iMessage; |
392 RBuf8 iMessage; |
|
393 |
348 /** |
394 /** |
349 * Key for the signature |
395 * Key for the signature |
350 */ |
396 */ |
351 RBuf8 iKey; |
397 RBuf8 iKey; |
352 }; |
398 }; |
356 */ |
402 */ |
357 class CSmfRsaKeyParameters : public CBase |
403 class CSmfRsaKeyParameters : public CBase |
358 { |
404 { |
359 public: |
405 public: |
360 /** |
406 /** |
361 * New methods |
407 * NewL method |
362 */ |
408 * @param aKeyName |
363 static CSmfRsaKeyParameters* NewL( |
409 * @param startDate |
364 const TDesC& aKeyName, const TTime& startDate, |
410 * @param endDate |
365 const TTime& endDate, const TDesC8& aKeyData ); |
411 * @param aKeydata |
|
412 * @return The constructed CSmfRsaKeyParameters instance |
|
413 */ |
|
414 static CSmfRsaKeyParameters* NewL( const TDesC& aKeyName, |
|
415 const TTime& startDate, |
|
416 const TTime& endDate, |
|
417 const TDesC8& aKeyData ); |
|
418 |
|
419 /** |
|
420 * Overloaded NewL method |
|
421 * @param aData |
|
422 * @return The constructed CSmfRsaKeyParameters instance |
|
423 */ |
366 static CSmfRsaKeyParameters* NewL( const TDesC8& aData ); |
424 static CSmfRsaKeyParameters* NewL( const TDesC8& aData ); |
367 |
425 |
368 /** |
426 /** |
369 * Destructor |
427 * Destructor |
370 */ |
428 */ |
371 ~CSmfRsaKeyParameters(); |
429 ~CSmfRsaKeyParameters(); |
|
430 |
372 /** |
431 /** |
373 * Method to externalize the member variables |
432 * Method to externalize the member variables |
374 * @param aStream The Write Stream to be filled. |
433 * @param aStream The Write Stream to be filled. |
375 */ |
434 */ |
376 void ExternalizeL( RWriteStream& aStream ) const; |
435 void ExternalizeL( RWriteStream& aStream ) const; |
377 /** |
436 |
378 * Get Method for keyname. |
437 /** |
|
438 * Method to get the key name |
|
439 * @return The key name |
379 */ |
440 */ |
380 const TDesC& KeyName() const; |
441 const TDesC& KeyName() const; |
381 /** |
442 |
382 * Get Method for keydata. |
443 /** |
|
444 * Method to get the key data |
|
445 * @return The key data |
383 */ |
446 */ |
384 const TDesC8& KeyData() const; |
447 const TDesC8& KeyData() const; |
385 /** |
448 |
386 * Get Method for start date. |
449 /** |
|
450 * Method to get the start date |
|
451 * @return The start date |
387 */ |
452 */ |
388 const TTime& StartDate() const; |
453 const TTime& StartDate() const; |
389 /** |
454 |
390 * Get Method for end date. |
455 /** |
|
456 * Method to get the end date |
|
457 * @return The end date |
391 */ |
458 */ |
392 const TTime& EndDate() const; |
459 const TTime& EndDate() const; |
393 |
460 |
394 private: |
461 private: |
395 /** |
462 /** |
396 * Two phase constructors |
463 * Two phase constructor |
397 */ |
464 * @param aKeyName |
398 void ConstructL( |
465 * @param startDate |
399 const TDesC& aKeyName, const TTime& startDate, |
466 * @param endDate |
400 const TTime& endDate, const TDesC8& aKeyData ); |
467 * @param aKeydata |
|
468 */ |
|
469 void ConstructL( const TDesC& aKeyName, |
|
470 const TTime& startDate, |
|
471 const TTime& endDate, |
|
472 const TDesC8& aKeyData ); |
|
473 |
|
474 /** |
|
475 * Two phase constructor |
|
476 * @param aData |
|
477 */ |
401 void ConstructL( const TDesC8& aData ); |
478 void ConstructL( const TDesC8& aData ); |
402 |
479 |
403 private: |
480 private: |
404 /** |
481 /** |
405 * Name of the key pair |
482 * Name of the key pair |
406 */ |
483 */ |
407 RBuf iKeyName; |
484 RBuf iKeyName; |
|
485 |
408 /** |
486 /** |
409 * Data of the key pair |
487 * Data of the key pair |
410 */ |
488 */ |
411 RBuf8 iKeyData; |
489 RBuf8 iKeyData; |
|
490 |
412 /** |
491 /** |
413 * Start date of validity |
492 * Start date of validity |
414 */ |
493 */ |
415 TTime iStartDate; |
494 TTime iStartDate; |
|
495 |
416 /** |
496 /** |
417 * End date of validity |
497 * End date of validity |
418 */ |
498 */ |
419 TTime iEndDate; |
499 TTime iEndDate; |
420 }; |
500 }; |