[Release] wrt-installer_0.0.73
[framework/web/wrt-installer.git] / src / commons / drm / drm-oem-intel.h
1 /*\r
2  *  drm-intel\r
3  *\r
4  * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved.\r
5  *\r
6  * Contact: Sunggun Jung        <sunggun.jung@samsung.com>\r
7  * \r
8  * This library is free software; you can redistribute it and/or modify it under\r
9  * the terms of the GNU Lesser General Public License as published by the\r
10  * Free Software Foundation; either version 2.1 of the License, or (at your option)\r
11  * any later version.\r
12  * \r
13  * This library is distributed in the hope that it will be useful, but WITHOUT ANY\r
14  * WARRANTY; without even the implied warranty of MERCHANTABILITY or\r
15  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public\r
16  * License for more details.\r
17  *\r
18  * You should have received a copy of the GNU Lesser General Public License\r
19  * along with this library; if not, write to the Free Software Foundation, Inc., 51\r
20  * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\r
21  *\r
22  */\r
23 \r
24 /**\r
25 * @internal\r
26 * @defgroup DRM-INTEL drm-intel\r
27 * @{  \r
28 */\r
29 #include "drm-intel-util.h"\r
30 //#include "drm-intel-crypto-util.h"\r
31 \r
32 #include <stdio.h>\r
33 #include <stdlib.h>\r
34 #include <string.h>\r
35 \r
36 /**   \r
37  *  An application can install Intel DRM license(DRO).\r
38  * \r
39  * @param[in]           pDroXML         Data String of the Rights Request\r
40  * @param[in]           droBufLen       pDroXML Length\r
41  * @return                      This function returns 1 on success or 0 on failure.\r
42  * @remarks     \r
43  * @see         \r
44  * @since         \r
45  */\r
46 int drm_oem_intel_install_license(char *pDroXML, int droBufLen);\r
47 \r
48 /**   \r
49  *  An application can uninstall Intel DRM license(DRO).\r
50  * \r
51  * @param[in]           pAppId          App-id of the rigths which want to un-install\r
52  * @return                      This function returns 1 on success or 0 on failure.\r
53  * @remarks     \r
54  * @see         \r
55  * @since         \r
56  */\r
57 int drm_oem_intel_uninstall_license(char *pAppId);\r
58 \r
59 /**   \r
60  *  An application can install CEK(Contents Encryption Key).\r
61  * \r
62  * @param[in]           pCekXML         Data String of the Rights Request\r
63  * @param[in]           cekBufLen       pDroXML Length\r
64  * @return                      This function returns 1 on success or 0 on failure.\r
65  * @remarks     \r
66  * @see         \r
67  * @since         \r
68  */\r
69 int drm_oem_intel_install_cek(char *pCekXML, int cekBufLen);\r
70 \r
71 /**   \r
72  *  An application can get decrypted contents(Apps) which is encrypted\r
73  * \r
74  * @param[in]   pDcfPath                Intel DRM Package File Path             \r
75  * @param[in]   pDecryptedFile  Decrypted File Path\r
76  * @return              This function returns 1 on success or 0 on failure.\r
77  * @remarks     \r
78  * @see\r
79  * @since\r
80  */\r
81 int drm_oem_intel_decrypt_package(char *pDcfPath, char *pDecryptedFile);\r
82 \r
83 /**   \r
84  *  An application can get informations of rights (DRO).\r
85  * \r
86  * @param[in]           pAppId          App-id of the rights which want to know\r
87  * @param[out]          pDro            The rights information about the app-id\r
88  * @return  This function can return any of the following codes\r
89  * DRM_INTEL_SUCCESS = 0        <success \r
90  * DRM_INTEL_LIC_VALID = 1      <License is valid \r
91  * DRM_INTEL_LIC_SUSPEND = 2    <License is valid but for future use \r
92  * DRM_INTEL_INVALID_ARG = -1000   <invalid argument\r
93  * DRM_INTEL_PARSING_ERROR = -999      <parsing contents or rights error\r
94  * DRM_INTEL_DB_ERROR = -998        <data base error \r
95  * DRM_INTEL_INSUFFICIENT_MEMORY = -997      <memory error \r
96  * DRM_INTEL_INTERNAL_ERROR = -996     <processing error\r
97  * DRM_INTEL_FILE_ERROR = -995       <file error\r
98  * DRM_INTEL_LIC_EXPIRED_DATETIME = -994    <Datetime License is expired\r
99  * DRM_INTEL_LIC_EXPIRED_COUNT = -993    <Count License is expired \r
100  * DRM_INTEL_LIC_NO_LICENCE = -992      <No License\r
101  * DRM_INTEL_LIC_IMEI_MISMATCH = -991    <IMEI is mismatching \r
102  * DRM_INTEL_LIC_PNUM_MISMATCH = -990    <PNUM is mismatching \r
103  * DRM_INTEL_UNKNOWN_ERROR = -1    <dummy error value\r
104  * @remarks     \r
105  * @see         \r
106  * @since         \r
107  */\r
108 int drm_oem_intel_getLicenseInfo(char *pAppId, T_DRO *pDro);\r
109 \r
110 /**   \r
111  *  An application can get informations of rights (DRO).\r
112  * \r
113  * @param[in]           pAppId          App-id of the rights which want to know\r
114  * @return  This function can return any of the following codes\r
115  * DRM_INTEL_SUCCESS = 0        <success \r
116  * DRM_INTEL_LIC_VALID = 1      <License is valid \r
117  * DRM_INTEL_LIC_SUSPEND = 2    <License is valid but for future use \r
118  * DRM_INTEL_INVALID_ARG = -1000   <invalid argument\r
119  * DRM_INTEL_PARSING_ERROR = -999      <parsing contents or rights error\r
120  * DRM_INTEL_DB_ERROR = -998        <data base error \r
121  * DRM_INTEL_INSUFFICIENT_MEMORY = -997      <memory error \r
122  * DRM_INTEL_INTERNAL_ERROR = -996     <processing error\r
123  * DRM_INTEL_FILE_ERROR = -995       <file error\r
124  * DRM_INTEL_LIC_EXPIRED_DATETIME = -994    <Datetime License is expired\r
125  * DRM_INTEL_LIC_EXPIRED_COUNT = -993    <Count License is expired \r
126  * DRM_INTEL_LIC_NO_LICENCE = -992      <No License\r
127  * DRM_INTEL_LIC_IMEI_MISMATCH = -991    <IMEI is mismatching \r
128  * DRM_INTEL_LIC_PNUM_MISMATCH = -990    <PNUM is mismatching \r
129  * DRM_INTEL_UNKNOWN_ERROR = -1    <dummy error value \r
130  * @remarks     \r
131  * @see         \r
132  * @since         \r
133  */\r
134 int drm_oem_intel_consume_license(char *pAppID);\r
135 \r
136 /**   \r
137  *  An application can veify the app's rights.\r
138  * \r
139  * @param[in]           pAppId          App-id of the rights which want to know\r
140  * @return      This function can return any of the following codes\r
141  * DRM_INTEL_SUCCESS = 0                 <success \r
142  * DRM_INTEL_LIC_VALID = 1       <License is valid \r
143  * DRM_INTEL_LIC_SUSPEND = 2     <License is valid but for future use \r
144  * DRM_INTEL_INVALID_ARG = -1000        <invalid argument\r
145  * DRM_INTEL_PARSING_ERROR = -999               <parsing contents or rights error\r
146  * DRM_INTEL_DB_ERROR = -998             <data base error \r
147  * DRM_INTEL_INSUFFICIENT_MEMORY = -997   <memory error \r
148  * DRM_INTEL_INTERNAL_ERROR = -996      <processing error\r
149  * DRM_INTEL_FILE_ERROR = -995    <file error\r
150  * DRM_INTEL_LIC_EXPIRED_DATETIME = -994         <Datetime License is expired\r
151  * DRM_INTEL_LIC_EXPIRED_COUNT = -993     <Count License is expired \r
152  * DRM_INTEL_LIC_NO_LICENCE = -992       <No License\r
153  * DRM_INTEL_LIC_IMEI_MISMATCH = -991     <IMEI is mismatching \r
154  * DRM_INTEL_LIC_PNUM_MISMATCH = -990     <PNUM is mismatching \r
155  * DRM_INTEL_UNKNOWN_ERROR = -1 <dummy error value \r
156 \r
157  * @remarks     \r
158  * @see         \r
159  * @since         \r
160  */\r
161 int drm_oem_intel_has_valid_license(char *pAppID);\r
162 \r
163 /**   \r
164  *  An application can check the file is drm enabled or not\r
165  * \r
166  * @param[in]   pDcfPath                The file path which want to check               \r
167   * @return             This function returns 1 on success or 0 on failure.\r
168  * @remarks     \r
169  * @see\r
170  * @since\r
171  */\r
172 int drm_oem_intel_isDrmFile(char *pDcfPath);\r