Add upgrade script
[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-service-apps.h
17  * @author   Sunggun Jung    <sunggun.jung@samsung.com>
18  * 
19  */
20
21 #ifndef __DRM_TIZEN_APPS_H__
22 #define __DRM_TIZEN_APPS_H__
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 #include <time.h>
29 #include "drm-tizen-error.h"
30
31
32 /**
33 * @internal
34 * @defgroup DRM-TAPPS drm-tapps
35 * @{  
36 */
37
38 /**   
39  *  An application can request generate request for getting License.
40  * 
41  * @param[in]        pRespBuf          Response Data String of the Purchase Request ( Null terminator string )
42  * @param[in]        respBufLen        pResBuf Length
43  * @param[in][out]   pReqBuf           License Request Data
44  * @param[in][out]   pReqBufLen        IN : pReqBuf Length, OUT : Rights Request Data String Size ( including null terminator )
45  * @param[in][out]   pLicenseUrl       License Acquisition URL Data
46  * @param[in][out]   pLicenseUrlLen    IN : pLicenseUrl Length, OUT : Rights Issuer Server URL Data String Size (  including null terminator )
47  * @return           This function returns TADC_SUCCESS(1) on success or an integer value other than 1 on failure.
48  * @remarks     
49  * @see              drm_tdc_generate_purchase_request
50  * @since         
51  */
52 int drm_tizen_generate_license_request(const char *pRespBuf, unsigned int respBufLen, char *pReqBuf, unsigned int *pReqBufLen, char *pLicenseUrl, unsigned int *pLicenseUrlLen);
53
54 /**   
55  *  An application can get TAD license which is encrypted.
56  *
57  * @param[in]        pRespBuf          Response Data String of the Rights Request ( Null terminator string )
58  * @param[in]        respBufLen        pResBuf Length
59  * @return           This function returns TADC_SUCCESS(1) on success or an integer value other than 1 on failure.
60  * @remarks     
61  * @see
62  * @since         
63  */
64 int drm_tizen_register_license(const char *pRespBuf, unsigned int respBufLen);
65
66 /**   
67  * API for checks whether the app drm file or not
68  * 
69  * @param[in]        pDcfPath          File path that to be checked whether the app drm file or not
70  * @param[in]        dcfPathLen        File path length that to be checked whether the app drm file or not
71  * @return           This function returns TADC_SUCCESS(1) on success or an integer value other than 1 on failure.
72  * @remarks
73  * @see
74  * @since         
75  */
76 int drm_tizen_is_drm_file(const char *pDcfPath, int dcfPathLen);
77
78 /**   
79  *  An application can get decrypted contents(Apps) which is encrypted.
80  * 
81  * @param[in]        pTADCFilepath     TDC DRM File Path        
82  * @param[in]        tadcFileLen       TDC DRM File length    
83  * @param[in]        pDecryptedFile    Decrypted File Path
84  * @param[in]        decryptedFileLen  Decrypted File length
85  * @return           This function returns TADC_SUCCESS(1) on success or an integer value other than 1 on failure.
86  * @remarks     
87  * @see
88  * @since         
89  */
90 //Decrypt DRM File
91 int drm_tizen_decrypt_package ( const char *pTADCFilepath, int tadcFileLen, 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, OUT : Purchase Request Data String Size ( including null terminator )
99  * @param[out]       pLicenseUrl       License Acquisition URL Data
100  * @param[in][out]   pLicenseUrlLen    IN : pLicenseUrl Length, OUT : License Server URL Data String Size (  including null terminator )
101  * @return           This function returns TADC_SUCCESS(1) on success or an integer value other than 1 on failure.
102  * @remarks     
103  * @see                DrmTdcGenerateLicenseRequest
104  * @since         
105  */
106 int drm_tizen_generate_purchase_request ( const char *pTADCFilepath, char *pReqBuf, unsigned int *pReqBufLen, char *pLicenseUrl, unsigned int *pLicenseUrlLen );
107
108 /**
109 *@}
110 */ /* Doxygen : addtogroup*/
111
112 #ifdef __cplusplus
113 }
114 #endif
115
116 #endif