1 drmlicensechecker.h |
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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: DRM License Checker interface definition |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef DRMLICENSECHECKER_H |
|
20 #define DRMLICENSECHECKER_H |
|
21 |
|
22 /** |
|
23 * Check and decrypt protected data files encrypted by the license manager. |
|
24 * |
|
25 * @lib DRMLicenseChecker.lib |
|
26 * @since Series 60 2.5 |
|
27 */ |
|
28 class CDRMLicenseChecker: public CBase |
|
29 { |
|
30 public: // Local enumerations and types |
|
31 |
|
32 enum |
|
33 { |
|
34 ENoRights = -100000, |
|
35 ERightsExpired = -100001, |
|
36 }; |
|
37 |
|
38 public: // Constructors and destructor |
|
39 |
|
40 /** |
|
41 * Two-phased constructor. |
|
42 */ |
|
43 IMPORT_C static CDRMLicenseChecker* NewL(); |
|
44 |
|
45 /** |
|
46 * Destructor. |
|
47 */ |
|
48 IMPORT_C virtual ~CDRMLicenseChecker(); |
|
49 |
|
50 public: // New functions |
|
51 |
|
52 /** |
|
53 * This function performs a license check by decrypting a data file and |
|
54 * returning the decrypted contents of the data file. A license check |
|
55 * can only succeed if a rights object associated with the calling |
|
56 * application exists and sufficient rights are present. If the license |
|
57 * check fails, an error is returned. |
|
58 * |
|
59 * @since Series 60 2.6 |
|
60 * @param aDataFile: the data file to be decrypted |
|
61 * @param aDataBuffer: memory buffer which contains the decrypted |
|
62 * contents of the data file. |
|
63 * @return ENoRights, ERightsExpired if the data file could not be opened |
|
64 * because of insufficient rights, Symbian-wide error codes or |
|
65 * KErrNone in case of success. |
|
66 */ |
|
67 IMPORT_C TInt CheckLicense( |
|
68 const TDesC& aDataFile, |
|
69 HBufC8*& aDataBuffer); |
|
70 |
|
71 private: |
|
72 |
|
73 /** |
|
74 * C++ default constructor. |
|
75 */ |
|
76 CDRMLicenseChecker(); |
|
77 |
|
78 /** |
|
79 * By default Symbian 2nd phase constructor is private. |
|
80 */ |
|
81 void ConstructL(); |
|
82 |
|
83 /** |
|
84 * Leaving version of CheckLicense |
|
85 * |
|
86 * @since Series 60 3.0 |
|
87 * @param aDataFile: the data file to be decrypted |
|
88 * @param aDataBuffer: memory buffer which contains the decrypted |
|
89 * contents of the data file. |
|
90 * @return ENoRights, ERightsExpired if the data file could not be opened |
|
91 * because of insufficient rights, Symbian-wide error codes or |
|
92 * KErrNone in case of success. |
|
93 */ |
|
94 void CheckLicenseL( |
|
95 const TDesC& aDataFile, |
|
96 HBufC8*& aDataBuffer); |
|
97 |
|
98 }; |
|
99 |
|
100 #endif // DRMLICENSECHECKER_H |
|
101 |
|
102 // End of File |