Fix coding style according to tizen rule
[platform/core/security/drm-service-core-tizen.git] / include / drm-tizen-apps.h
1 /*
2  * Copyright (c) 2000-2015 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Flora License, Version 1.1 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://floralicense.org/license/
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  * @file     drm-tizen-apps.h
17  * @author   Sunggun Jung <sunggun.jung@samsung.com>
18  */
19 #ifndef __DRM_TIZEN_APPS_H__
20 #define __DRM_TIZEN_APPS_H__
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 #include <time.h>
27 #include "drm-tizen-error.h"
28
29 /**
30 * @internal
31 * @defgroup DRM-TAPPS drm-tapps
32 * @{
33 */
34
35 /**
36  * An application can request generate request for getting License.
37  *
38  * @param[in]      pRespBuf       Response Data String of the Purchase Request
39  *                                (Null terminator string)
40  * @param[in]      respBufLen     pResBuf Length
41  * @param[in][out] pReqBuf        License Request Data
42  * @param[in][out] pReqBufLen     IN : pReqBuf Length
43  *                                OUT : Rights Request Data String Size
44  *                                      (including null terminator)
45  * @param[in][out] pLicenseUrl    License Acquisition URL Data
46  * @param[in][out] pLicenseUrlLen IN : pLicenseUrl Length
47  *                                OUT : Rights Issuer Server URL Data String Size
48  *                                (including null terminator)
49  *
50  * @return TADC_SUCCESS(1) on success or an integer value other than 1 on failure.
51  *
52  * @see drm_tdc_generate_purchase_request()
53  */
54 int drm_tizen_generate_license_request(
55         const char *pRespBuf, unsigned int respBufLen,
56         char *pReqBuf, unsigned int *pReqBufLen,
57         char *pLicenseUrl, unsigned int *pLicenseUrlLen);
58
59 /**
60  * An application can get TAD license which is encrypted.
61  *
62  * @param[in] pRespBuf   Response Data String of the Rights Request
63  *                       (Null terminator string)
64  * @param[in] respBufLen pResBuf Length
65  * @return TADC_SUCCESS(1) on success or an integer value other than 1 on failure.
66  */
67 int drm_tizen_register_license(const char *pRespBuf, unsigned int respBufLen);
68
69 /**
70  * Checks whether the app drm file or not
71  *
72  * @param[in] pDcfPath   File path that to be checked whether the app drm file or not
73  * @param[in] dcfPathLen File path length that to be checked whether the app
74  *                       drm file or not
75  *
76  * @return TADC_SUCCESS(1) on success or an integer value other than 1 on failure.
77  */
78 int drm_tizen_is_drm_file(const char *pDcfPath, int dcfPathLen);
79
80 /**
81  * An application can get decrypted contents(Apps) which is encrypted.
82  *
83  * @param[in] pTADCFilepath     TDC DRM File Path
84  * @param[in] tadcFileLen       TDC DRM File length
85  * @param[in] pDecryptedFile    Decrypted File Path
86  * @param[in] decryptedFileLen  Decrypted File length
87  *
88  * @return TADC_SUCCESS(1) on success or an integer value other than 1 on failure.
89  */
90 int drm_tizen_decrypt_package(const char *pTADCFilepath, int tadcFileLen,
91                                                           const char *pDecryptedFile, int decryptedFileLen);
92
93 /**
94  * An application can request purchase request for getting License.
95  *
96  * @param[in]      pTADCFilepath     File path of Tizen Apps DRM contents
97  * @param[out]     pReqBuf           Purchase Request Data
98  * @param[in][out] pReqBufLen        IN : pReqBuf Length
99  *                                   OUT : Purchase Request Data String Size
100  *                                   (including null terminator)
101  * @param[out]     pLicenseUrl       License Acquisition URL Data
102  * @param[in][out] pLicenseUrlLen    IN : pLicenseUrl Length
103  *                                   OUT : License Server URL Data String Size
104  *                                   (including null terminator)
105  *
106  * @return TADC_SUCCESS(1) on success or an integer value other than 1 on failure.
107  *
108  * @see DrmTdcGenerateLicenseRequest()
109  */
110 int drm_tizen_generate_purchase_request(const char *pTADCFilepath,
111                                                                                 char *pReqBuf, unsigned int *pReqBufLen, char *pLicenseUrl,
112                                                                                 unsigned int *pLicenseUrlLen);
113
114 /**
115 *@}
116 */
117
118 #ifdef __cplusplus
119 }
120 #endif
121
122 #endif //__DRM_TIZEN_APPS_H__