|
1 /* |
|
2 * Copyright (c) 2003-2005 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: This class is the client side handle of DRM Engine |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef RDRMRIGHTSCLIENT_H |
|
21 #define RDRMRIGHTSCLIENT_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32std.h> |
|
25 #include <Oma2Agent.h> |
|
26 #include <DRMTypes.h> |
|
27 |
|
28 using namespace ContentAccess; |
|
29 |
|
30 // CONSTANTS |
|
31 // MACROS |
|
32 |
|
33 // DATA TYPES |
|
34 // FUNCTION PROTOTYPES |
|
35 // FORWARD DECLARATIONS |
|
36 class RFs; |
|
37 class CDRMPermission; |
|
38 |
|
39 // CLASS DECLARATION |
|
40 |
|
41 /** |
|
42 * This class is the client side interface for DRM3 Rights Server. |
|
43 * This class can be used to access the DRM Rights Database. |
|
44 * |
|
45 * @lib DRM Core |
|
46 * @since S60 Release 2.5 |
|
47 */ |
|
48 class RDRMRightsClient : public RSessionBase |
|
49 { |
|
50 public: // Constructor & destructor |
|
51 /** |
|
52 * C++ default constructor. |
|
53 */ |
|
54 IMPORT_C RDRMRightsClient(); |
|
55 |
|
56 /** |
|
57 * Destructor. |
|
58 */ |
|
59 IMPORT_C virtual ~RDRMRightsClient(); |
|
60 |
|
61 /** |
|
62 * This method opens the connection between the client and the server. |
|
63 * @since 2.5 |
|
64 * @return Error code. KErrNone if the operation is successful. |
|
65 */ |
|
66 IMPORT_C TInt Connect(); |
|
67 |
|
68 /** |
|
69 * This function closes the connection between the client and the server. |
|
70 * It is safe to call this method even if connection is not established. |
|
71 * @since S60Rel2.5 |
|
72 */ |
|
73 IMPORT_C void Close(); |
|
74 |
|
75 public: // New functions |
|
76 |
|
77 /** |
|
78 * Starts the rights server in case it is not yet started. It is |
|
79 * safe to call this method even if the server is running. |
|
80 * @since S60Rel3.0 |
|
81 * @return Symbian OS error code if any. |
|
82 */ |
|
83 IMPORT_C static TInt StartServer(); |
|
84 |
|
85 /** |
|
86 * Adds the given rights object into rights database. |
|
87 * @since S60Rel2.5 |
|
88 * @param aCEK CEK. |
|
89 * @param aRightsObject Rights object to be added. |
|
90 * @param aCID Content-ID. |
|
91 * @return Error code. |
|
92 */ |
|
93 IMPORT_C TInt AddRecord( |
|
94 const TDesC8& aCEK, |
|
95 const CDRMPermission& aRightsObject, |
|
96 const TDesC8& aCID, |
|
97 TDRMUniqueID& aID ); |
|
98 |
|
99 /** |
|
100 * Adds a protected RO where the CEK wrapped with another key. |
|
101 * @since 3.0 |
|
102 * @param aProtectedCek wrapped CEK |
|
103 * @param aDomainPermission Domain or regular permission |
|
104 * @param aRightsObject Rights object to be added. |
|
105 * @param aCID Content-ID. |
|
106 * @return Error code. |
|
107 */ |
|
108 |
|
109 IMPORT_C TInt AddProtectedRecord( |
|
110 const TDesC8& aProtectedCek, |
|
111 TBool aDomainRecord, |
|
112 const CDRMPermission& aRightsObject, |
|
113 const TDesC8& aCID, |
|
114 TDRMUniqueID& aID ); // Unique ID, out-parameter |
|
115 |
|
116 /** |
|
117 * Gets all database entries related to specified Content-ID. |
|
118 * @since S60Rel2.5 |
|
119 * @param aId Content ID. |
|
120 * @param aRightsList List of rights objects. |
|
121 */ |
|
122 IMPORT_C void GetDBEntriesL( |
|
123 const TDesC8& aId, |
|
124 RPointerArray< CDRMPermission >& aRightsList ); |
|
125 |
|
126 /** |
|
127 * Gets a database entry related to given content ID and unique ID. |
|
128 * @since S60Rel2.5 |
|
129 * @param aContentID Content-ID. |
|
130 * @param aUniqueID Unique identifier. |
|
131 * @return Associated rights object. |
|
132 */ |
|
133 IMPORT_C CDRMPermission* GetDbEntryL( |
|
134 const TDesC8& aContentID, |
|
135 const TDRMUniqueID& aUniqueID ); |
|
136 |
|
137 /** |
|
138 * Deletes all rights objects with specified Content-ID. |
|
139 * @since S60Rel2.5 |
|
140 * @param aContentID Content-ID of the rights objects to be deleted. |
|
141 * @return Error code. KErrNone if successful. |
|
142 */ |
|
143 IMPORT_C TInt DeleteDbEntry( const TDesC8& aContentID ); |
|
144 |
|
145 /** |
|
146 * Deletes one rights object, identified by Content-ID and unique ID. |
|
147 * @since S60Rel2.5 |
|
148 * @param aContentID Content-ID of the rights object. |
|
149 * @param aUniqueID Unique ID. |
|
150 * @return Error code. KErrNone if successful operation. |
|
151 */ |
|
152 IMPORT_C TInt DeleteDbEntry( |
|
153 const TDesC8& aContentID, |
|
154 const TDRMUniqueID& aUniqueID ); |
|
155 |
|
156 /** |
|
157 * Exports all content ID's from the database to a file. |
|
158 * @since S60Rel2.5 |
|
159 * @param aFileName Out-parameter: contains the name of the file |
|
160 * if the method completes with KErrNone. The |
|
161 * descriptor parameter is assumed to be large |
|
162 * enough. The caller is responsible of deleting |
|
163 * the file afterwards. |
|
164 * @return Error code. KErrNone if successful operation. |
|
165 */ |
|
166 IMPORT_C TInt ExportContentIDList( TDes& aFileName ); |
|
167 |
|
168 /** |
|
169 * This method exports all Content-IDs from the database file |
|
170 * in an array. The caller is responsible of destroying the array |
|
171 * afterwards. |
|
172 * @since S60Rel2.5 |
|
173 * @param aCIDList An out-parameter: contains the Content-IDs |
|
174 * after successful return. |
|
175 * @return A Symbian OS error code or DRM3 error code. KErrNone in |
|
176 * successful operation. |
|
177 */ |
|
178 IMPORT_C TInt ExportContentIDList( RPointerArray< HBufC8 >& aCIDList ); |
|
179 |
|
180 /** |
|
181 * Returns the decryption key to the content. |
|
182 * |
|
183 * @since 2.5 |
|
184 * @param aIntent In-parameter: How the content is going to be consumed. |
|
185 * @param aContentID Content-ID of the related content. |
|
186 * @param aKey Out-parameter: Contains the key if function returns |
|
187 * successfully. |
|
188 * @return Error code. KErrNone if successful operation. |
|
189 */ |
|
190 IMPORT_C TInt GetDecryptionKey( |
|
191 const TInt aIntent, |
|
192 const TDesC8& aContentID, |
|
193 TDes8& aKey ); |
|
194 |
|
195 /** |
|
196 * This method checks whether the caller has sufficient rights over |
|
197 * the content at this very moment. |
|
198 * @param aIntent Intended usage. |
|
199 * @param aContentID Content-ID. |
|
200 * @return KErrNone in successful |
|
201 * completition. |
|
202 */ |
|
203 IMPORT_C TInt CheckRights( |
|
204 const TInt aIntent, |
|
205 const TDesC8& aContentID, |
|
206 TUint32& aRejection ); |
|
207 |
|
208 /** |
|
209 * This method checks whether the caller has sufficient rights over |
|
210 * the content at this very moment. It also returns the active rights. |
|
211 * @param aIntent Intended usage. |
|
212 * @param aContentID Content-ID. |
|
213 * @return Permission for the intent. NULL if no permissions exist |
|
214 * completition. |
|
215 */ |
|
216 IMPORT_C CDRMPermission* GetActiveRightsL( |
|
217 const TInt aIntent, |
|
218 const TDesC8& aContentID, |
|
219 TUint32& aRejection ); |
|
220 |
|
221 /** |
|
222 * Sets the key for subsequent encryption and decryption operations. |
|
223 * The key is stored on the server side in the session and will |
|
224 * be usable until the session is closed. The key will be fetched |
|
225 * from the rights database by looking up the content ID. |
|
226 * |
|
227 * @param aContentId Content ID to get the key for |
|
228 * @return KErrNone if the key was initialized properly |
|
229 */ |
|
230 IMPORT_C TInt InitializeKey( const TDesC8& aContentId ); |
|
231 |
|
232 /** |
|
233 * Similar to InitializeKeyL, but sets the key by using a group |
|
234 * key as the input. |
|
235 * |
|
236 * @param aContentId Group ID to get the key for |
|
237 * @param aGroupKey Group key |
|
238 * @param aEncryptionMethod encryption method |
|
239 * @return KErrNone if the key was initialized properly |
|
240 */ |
|
241 IMPORT_C TInt InitializeGroupKey( |
|
242 const TDesC8& aGroupId, |
|
243 const TDesC8& aGroupKey, |
|
244 TEncryptionMethod aMethod ); |
|
245 |
|
246 /** |
|
247 * Encrypts data using the session key. The data parameter must |
|
248 * have enough space to accomodate for the addition of the paddding |
|
249 * if it shall be added (up to 32 bytes more data) |
|
250 * |
|
251 * @param aIv AES CBC initialization vector |
|
252 * @param aData data to be encrypted, encrypted data on return |
|
253 * @return KErrNone if the encryption succeeded |
|
254 */ |
|
255 IMPORT_C TInt Encrypt( |
|
256 const TDesC8& aIv, |
|
257 TPtr8& aData, |
|
258 TBool aAddPadding = EFalse ); |
|
259 |
|
260 /** |
|
261 * Decrypts data using the session key. Padding will be removed |
|
262 * if requested. |
|
263 * |
|
264 * @param aIv AES CBC initialization vector |
|
265 * @param aData data to be encrypted, encrypted data on return |
|
266 * @return KErrNone if the encryption succeeded |
|
267 */ |
|
268 IMPORT_C TInt Decrypt( |
|
269 const TDesC8& aIv, |
|
270 TPtr8& aData, |
|
271 TBool aRemovePadding = EFalse ); |
|
272 /** |
|
273 * Returns the amount of unique URIs in the database. |
|
274 * @since 2.5 |
|
275 * @return => 0: Amount of ROs, |
|
276 * < 0 : error. |
|
277 */ |
|
278 IMPORT_C TInt Count(); |
|
279 |
|
280 /** |
|
281 * Empties the rights database totally. |
|
282 * @since 2.5 |
|
283 * @return Symbian OS / DRM3 wide error code. |
|
284 */ |
|
285 IMPORT_C TInt DeleteAll(); |
|
286 |
|
287 /** |
|
288 * Consume the right with specific contentID and intent |
|
289 * @since 2.5 |
|
290 * @return Symbian OS / DRM3 wide error code. |
|
291 */ |
|
292 IMPORT_C TInt Consume( |
|
293 const TInt aIntent, |
|
294 const TDesC8& aContentID); |
|
295 |
|
296 /** |
|
297 * Check if Consume is possible. Does not consume rights. |
|
298 * @since 3.0 |
|
299 * @return KErrNone if Consume is possible |
|
300 */ |
|
301 IMPORT_C TInt CheckConsume( |
|
302 const TInt aIntent, |
|
303 const TDesC8& aContentID); |
|
304 |
|
305 /** |
|
306 * Calculate the padding amount for a data block |
|
307 * @since 3.0 |
|
308 * @return The padding value |
|
309 */ |
|
310 IMPORT_C TInt CalculatePadding( |
|
311 const TDesC8& aLastTwoDataBlocks); |
|
312 |
|
313 IMPORT_C TInt ForwardLockURI( HBufC8*& aURI ); |
|
314 |
|
315 /** |
|
316 * AddDomainRO |
|
317 * |
|
318 * Add the xml representation of the domain RO to the database |
|
319 * |
|
320 * @param aRoId : the rights object id of the domain ro |
|
321 * @param aXmlData : the xml data of the rights object |
|
322 * @return Symbian OS error code |
|
323 */ |
|
324 IMPORT_C TInt AddDomainRO( |
|
325 const TDesC8& aRoId, |
|
326 const TDesC8& aXmlData ); |
|
327 |
|
328 /** |
|
329 * GetDomainROL |
|
330 * |
|
331 * Get the xml representation of the domain RO from the database |
|
332 * |
|
333 * @param aRoId : the rights object id of the domain ro |
|
334 * @return Functional RO xml representation or Leave with |
|
335 * Symbian OS error code |
|
336 */ |
|
337 IMPORT_C HBufC8* GetDomainROL( const TDesC8& aRoId ); |
|
338 |
|
339 /** |
|
340 * GetDomainRoForCidL |
|
341 * |
|
342 * Get the domain RO for a content ID from the database |
|
343 * |
|
344 * @param aContentId the content ID of the domain ro |
|
345 * @param aRoList list of domain rights objects for this ID |
|
346 * @return Symbian OS error code |
|
347 */ |
|
348 IMPORT_C void GetDomainRosForCidL( |
|
349 const TDesC8& aContentId, |
|
350 RPointerArray<HBufC8>& aRoList ); |
|
351 |
|
352 /** |
|
353 * DeleteDomainRO |
|
354 * |
|
355 * Delete the xml representation of the domain RO from the database |
|
356 * |
|
357 * @param aRoId : the rights object id of the domain ro |
|
358 * @return Symbian OS error code |
|
359 */ |
|
360 IMPORT_C TInt DeleteDomainRO( const TDesC8& aRoId ); |
|
361 |
|
362 /** |
|
363 * IsInReplayCache |
|
364 * |
|
365 * Checks whether the protected RO identified by aID and aTime |
|
366 * has already been added to Replay Cache. |
|
367 * |
|
368 * @param aID: rights ID |
|
369 * @param aTime: RO timestamp |
|
370 * @param aInCache: out-parameter: boolean result |
|
371 * @return Symbian OS error code |
|
372 */ |
|
373 IMPORT_C TInt IsInCache( const TDesC8& aID, |
|
374 const TTime& aTime, |
|
375 TBool& aInCache ); |
|
376 |
|
377 /** |
|
378 * IsInReplayCache |
|
379 * |
|
380 * Checks whether the protected RO identified by aID |
|
381 * has already been added to Replay Cache. |
|
382 * |
|
383 * @param aID: rights ID |
|
384 * param aInCache: out-parameter: boolean result |
|
385 * @return Symbian OS error code |
|
386 */ |
|
387 IMPORT_C TInt IsInCache( const TDesC8& aID, |
|
388 TBool& aInCache ); |
|
389 |
|
390 /** |
|
391 * AddToReplayCache |
|
392 * |
|
393 * Adds an entry to Replay Cache. |
|
394 * Note! Does not check whether the entry is already in cache. Use |
|
395 * IsInCache() first to determine whether the entry already exists. |
|
396 * |
|
397 * @param aID: RO ID |
|
398 * @param aTIme: RO timestamp |
|
399 * @return Symbian OS error code. |
|
400 */ |
|
401 IMPORT_C TInt AddToCache( const TDesC8& aID, |
|
402 const TTime& aTime ); |
|
403 |
|
404 /** |
|
405 * AddToReplayCache |
|
406 * |
|
407 * Adds an entry to Replay Cache. |
|
408 * Note! Does not check whether the entry is already in cache. Use |
|
409 * IsInCache() first to determine whether the entry already exists. |
|
410 * |
|
411 * @param aID: RO ID |
|
412 * @return Symbian OS error code. |
|
413 */ |
|
414 IMPORT_C TInt AddToCache( const TDesC8& aID ); |
|
415 |
|
416 /** |
|
417 * DeleteExpiredPermissions |
|
418 * |
|
419 * Deletes expired permissions from the rights database |
|
420 * Note this function will possibly take a lot of time to complete |
|
421 * and if the drm time is not available it does not touch any time |
|
422 * based rights |
|
423 * |
|
424 * @param aStatus: asynchronous request status |
|
425 * @return none |
|
426 */ |
|
427 IMPORT_C void DeleteExpiredPermissions( TRequestStatus& aStatus ); |
|
428 |
|
429 /** |
|
430 * SetEstimatedArrival |
|
431 * |
|
432 * Sets the time in which the rights object should arrive |
|
433 * |
|
434 * @since 3.0 |
|
435 * @param aContentID : content URI |
|
436 * @param aDeltaSeconds : time in seconds to wait for rights |
|
437 * @return Symbian OS error code if any. |
|
438 */ |
|
439 IMPORT_C TInt SetEstimatedArrival( const TDesC8& aContentID, |
|
440 TTimeIntervalSeconds aDeltaSeconds ); |
|
441 |
|
442 /** |
|
443 * GetEstimatedArrival |
|
444 * |
|
445 * Gets the time in which the rights object should arrive |
|
446 * |
|
447 * @since 3.0 |
|
448 * @param aContentID : content URI |
|
449 * @param aDeltaSeconds : time in seconds to wait for rights |
|
450 * -1 if the content should have arrived |
|
451 * @return Symbian OS error code if any. |
|
452 * KErrNotFound if the content is not in the list |
|
453 */ |
|
454 IMPORT_C TInt GetEstimatedArrival( const TDesC8& aContentID, |
|
455 TTimeIntervalSeconds& aDeltaSeconds ); |
|
456 |
|
457 |
|
458 /** |
|
459 * SetName |
|
460 * |
|
461 * Associates a human-readable name to given content-ID. |
|
462 * |
|
463 * @since 3.0 |
|
464 * @param aContentID: Content URI. |
|
465 * @param aName: New name. |
|
466 * @return Symbian OS error code if any |
|
467 */ |
|
468 IMPORT_C TInt SetName( const TDesC8& aContentID, |
|
469 const TDesC& aName ); |
|
470 |
|
471 /** |
|
472 * GetName |
|
473 * |
|
474 * Retrieves the human-readable name associated to given content-ID |
|
475 * |
|
476 * @since 3.0 |
|
477 * @param aContentID: Content URI. |
|
478 * @param aName: Out-parameter: The name associated to content. |
|
479 * @return Symbian OS error code if any. KErrNotFound in case the |
|
480 * content URI is not in the database. |
|
481 */ |
|
482 IMPORT_C TInt GetName( const TDesC8& aContentID, |
|
483 HBufC*& aName ); |
|
484 |
|
485 /** |
|
486 * Cancel |
|
487 * |
|
488 * Cancel any asynchronous operation. |
|
489 * |
|
490 * @since 3.0 |
|
491 */ |
|
492 IMPORT_C void Cancel(); |
|
493 |
|
494 /** |
|
495 * GetUdtData |
|
496 * |
|
497 * Retrieves the udt data from the server |
|
498 * |
|
499 * @since 3.0 |
|
500 * @param aUdtData: the udt data |
|
501 * @return Symbian OS error code if any. KErrNotFound in case the |
|
502 * content URI is not in the database. |
|
503 */ |
|
504 IMPORT_C TInt GetUdtData( TDes8& aUdtData ); |
|
505 |
|
506 /** |
|
507 * InitializeUdt |
|
508 * |
|
509 * Initializes the user data transfer |
|
510 * |
|
511 * @since 3.0 |
|
512 * @param aKey : Encryption key of the udt file encrypted with the |
|
513 * device public key |
|
514 * @return Symbian OS error code if any. KErrNotFound in case the |
|
515 * content URI is not in the database. |
|
516 */ |
|
517 IMPORT_C TInt InitiateUdt( const TDesC8& aKey ); |
|
518 |
|
519 |
|
520 /** |
|
521 * Initializes the export all orphaned content ID's. |
|
522 * When the request completes, you can ask for the |
|
523 * contents with the ExportOrphanedContentIdList functions |
|
524 * |
|
525 * @since 3.0 |
|
526 * @param aPerformScan : ETrue if file system scan needs to be |
|
527 * performed |
|
528 * EFalse if not |
|
529 * @param aStatus : Request status for the asynchronous call |
|
530 * @return None |
|
531 */ |
|
532 IMPORT_C void InitOrphanedContentIdList( TBool aPerformScan, |
|
533 TRequestStatus& aStatus ); |
|
534 |
|
535 |
|
536 /** |
|
537 * Exports all orphaned content ID's from the database to a file. |
|
538 * @since 3.0 |
|
539 * @param aFileName Out-parameter: contains the name of the file |
|
540 * if the method completes with KErrNone. The |
|
541 * descriptor parameter is assumed to be large |
|
542 * enough. The caller is responsible of deleting |
|
543 * the file afterwards. |
|
544 * @param aPerformScan : ETrue if file system scan needs to be |
|
545 * performed |
|
546 * EFalse if not |
|
547 * @return Error code. KErrNone if successful operation. |
|
548 */ |
|
549 IMPORT_C TInt ExportOrphanedContentIdList( TDes& aFileName ); |
|
550 |
|
551 /** |
|
552 * Exports all orphaned content ID's from the database |
|
553 * in an array. The caller is responsible of destroying the array |
|
554 * afterwards. |
|
555 * @since 3.0 |
|
556 * @param aContentIdList : An out-parameter: contains the Content-IDs |
|
557 * after successful return. |
|
558 * @param aPerformScan : ETrue if file system scan needs to be |
|
559 * performed |
|
560 * EFalse if not |
|
561 * @return A Symbian OS error code or DRM error code. KErrNone in |
|
562 * successful operation. |
|
563 */ |
|
564 IMPORT_C TInt ExportOrphanedContentIdList( |
|
565 RPointerArray<HBufC8>& aContentIdList); |
|
566 |
|
567 IMPORT_C TInt EncodeRightsIssuerField( const TDesC8& aOldValue, |
|
568 HBufC8*& aNewValue ); |
|
569 |
|
570 IMPORT_C TInt DecodeRightsIssuerField( const TDesC8& aEncoded, |
|
571 HBufC8*& aDecoded ); |
|
572 |
|
573 /** |
|
574 * Sets the authentication seed data for a content ID |
|
575 * @since 3.0 |
|
576 * @param aContentID Content ID |
|
577 * @param aSeed Authentication seed |
|
578 * @return Error code. KErrNone if successful operation. |
|
579 */ |
|
580 IMPORT_C TInt SetAuthenticationSeed( const TDesC8& aContentId, |
|
581 const TDesC8& aSeed ); |
|
582 |
|
583 /** |
|
584 * GSets the authentication seed data for a content ID |
|
585 * @since 3.0 |
|
586 * @param aContentID Content ID |
|
587 * @param aSeed Authentication seed |
|
588 * @return Error code. KErrNone if successful operation. |
|
589 */ |
|
590 IMPORT_C TInt GetAuthenticationSeed( const TDesC8& aContentId, |
|
591 TDes8& aSeed ); |
|
592 /** |
|
593 * Integrity protection for protected ROs. Calculates HMAC value |
|
594 * usign aSignedInfoElement and MAC key. MAC key is unwrapped |
|
595 * in AddRecord method. So AddRecord must be called successfully |
|
596 * before this method can be called. |
|
597 * |
|
598 * @since 3.0 |
|
599 * @param aSignedInfoElement Complete XML ro element <roap:ro> |
|
600 * @param aMacValue MAC value from protectedRO element |
|
601 * @return Error code. KErrNone if successful operation. |
|
602 KErrRightsServerMacFailed, if MAC validation fails |
|
603 */ |
|
604 IMPORT_C TInt VerifyMacL( const TDesC8& aSignedInfoElement, |
|
605 const TDesC8& aMacValue ) const; |
|
606 |
|
607 |
|
608 /** |
|
609 * Retrieve the individuals from the Rights Server so proper |
|
610 * comparisons of rights object validity can be performed outside |
|
611 * of the rights server |
|
612 * |
|
613 * @since 3.1 |
|
614 * @param aIndividuals : Pointer array of the individuals supported |
|
615 * @return Error code with server side error. |
|
616 * KErrNone if successful operation. |
|
617 */ |
|
618 IMPORT_C TInt GetSupportedIndividualsL( |
|
619 RPointerArray<HBufC8>& aIndividuals) const; |
|
620 |
|
621 /** |
|
622 * Stop watching the DCF repository server |
|
623 * |
|
624 * @since 3.1 |
|
625 */ |
|
626 IMPORT_C void StopWatching() const; |
|
627 |
|
628 |
|
629 /** |
|
630 * Unwraps MAC and REK keys that are protected using device public key |
|
631 * or domain key. If the keys are wrapped with device public key aDomainId |
|
632 * parameter must be set to zero length. |
|
633 * |
|
634 * @since 3.1 |
|
635 * @param aMacAndRek : Public key protected MAC and REK keys |
|
636 * @param aTransportScheme: Used key wrapping scheme (e.g. OMA or CMLA) |
|
637 * @param aRightsIssuerId: Defines the RI that has wrapped the keys |
|
638 * @param aDomainId: Defines the domain key that used for wrapping the keys. |
|
639 * If a device public key is used, the length of aDomainId must be zero |
|
640 * @return Error code with server side error. |
|
641 * KErrNone if successful operation. |
|
642 */ |
|
643 IMPORT_C TInt UnwrapMacAndRek( const TDesC8& aMacAndRek, |
|
644 TKeyTransportScheme aTransportScheme, |
|
645 const TDesC8& aRightsIssuerId, |
|
646 const TDesC8& aDomainId ) const; |
|
647 |
|
648 /** |
|
649 * Fills the input buffer with random data. The length of the aRandomData must |
|
650 * be set to the correct value. |
|
651 * |
|
652 * @since 3.1 |
|
653 * @param aRandomData : Out-parameter that will be filled with random data |
|
654 */ |
|
655 IMPORT_C void GetRandomDataL( TDes8& aRandomData ) const; |
|
656 |
|
657 /** |
|
658 * Returns the metering data for the requested rights-issuer id |
|
659 * |
|
660 * @since 3.2 |
|
661 * @param aRiId : Rights-Issuer Id for which the metering data is acquired |
|
662 * @return MeteringData which includes the cipher data and all tags inside |
|
663 * meteringReport -element |
|
664 */ |
|
665 |
|
666 IMPORT_C HBufC8* GetMeteringDataL( const TDesC8& aRiId ); |
|
667 |
|
668 /** |
|
669 * Deletes the metering data of the requested rights-issuer id |
|
670 * |
|
671 * @since 3.2 |
|
672 * @param aRiId : Rights-Issuer Id for which the metering data is deleted |
|
673 * @return Error code with server side error. |
|
674 * KErrNone if successful operation. |
|
675 */ |
|
676 |
|
677 IMPORT_C TInt DeleteMeteringDataL( const TDesC8& aRiId ); |
|
678 |
|
679 |
|
680 public: // Functions from base classes |
|
681 |
|
682 protected: // New functions |
|
683 |
|
684 protected: // Functions from base classes |
|
685 |
|
686 private: |
|
687 |
|
688 /** |
|
689 * Convert internally used temporary file into list. |
|
690 * @since S60Rel2.5 |
|
691 * @param aFs Open file server session. |
|
692 * @param aFileName Source file name |
|
693 * @param aList Destination list. |
|
694 */ |
|
695 void FileToListL( RFs& aFs, |
|
696 const TDesC& aFileName, |
|
697 RPointerArray< CDRMPermission >& aList ); |
|
698 /** |
|
699 * Converts a file of URIs into an array. |
|
700 * @since S60Rel2.5 |
|
701 * @param aFs Open file server session. |
|
702 * @param aFile Input file. |
|
703 * @param aList Output list. |
|
704 */ |
|
705 void URIFileToArrayL( RFs& aFs, |
|
706 const TDesC& aFile, |
|
707 RPointerArray< HBufC8 >& aList ); |
|
708 |
|
709 |
|
710 // Prohibit copy constructor if not deriving from CBase. |
|
711 RDRMRightsClient( const RDRMRightsClient& ); |
|
712 // Prohibit assigment operator if not deriving from CBase. |
|
713 RDRMRightsClient& operator=( const RDRMRightsClient& ); |
|
714 |
|
715 public: // Data |
|
716 |
|
717 protected: // Data |
|
718 |
|
719 private: // Data |
|
720 TAny* iPtr; // Reserved for future use |
|
721 |
|
722 public: // Friend classes |
|
723 |
|
724 protected: // Friend classes |
|
725 |
|
726 private: // Friend classes |
|
727 }; |
|
728 |
|
729 #endif // RDRMRIGHTSCLIENT_H |
|
730 |
|
731 // End of File |