2 * Copyright (c) 2000-2015 Samsung Electronics Co., Ltd.
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
8 * http://floralicense.org/license/
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.
16 #ifndef __DRMTDCSVC_H_
17 #define __DRMTDCSVC_H_
19 #include "TADC_Core.h"
22 * TDC DRM File Header Info
25 char cid[1024]; // Content ID
26 char riurl[1024]; // Rights Issuer URL
30 * An application can get file Header Info
32 * @param[in] filePath file path of Tizen Apps DRM contents
33 * @param[out] pFileHeader Pointer to be stored TAD Header information.
35 * @return TRUE on success or FALSE on failure.
37 bool DrmTdcGetFileHeader(const char *pTADCFilepath,
38 DrmTdcFileHeader *pFileHeader);
41 * An application can request purchase request for getting License.
43 * @param[in] pTADCFilepath File path of Tizen Apps DRM contents
44 * @param[out] pReqBuf Purchase Request Data
45 * @param[in][out] pReqBufLen IN : pReqBuf Length
46 * OUT : Purchase Request Data String Size
47 * (including null terminator)
48 * @param[out] pLicenseUrl License Acquisition URL Data
49 * @param[in][out] pLicenseUrlLen IN : pLicenseUrl Length
50 * OUT : License Server URL Data String Size
51 * (including null terminator)
53 * @return TRUE on success or FALSE on failure.
55 * @see DrmTdcGenerateLicenseRequest()
57 bool DrmTdcGeneratePurchaseRequest(const char *pTADCFilepath, char *pReqBuf,
58 unsigned int *pReqBufLen, char *pLicenseUrl, unsigned int *pLicenseUrlLen);
61 * An application can request generate request for getting License.
63 * @param[in] pRespBuf Response Data String of the Purchase Request
64 * (Null terminator string)
65 * @param[in] respBufLen pResBuf Length
66 * @param[in][out] pReqBuf License Request Data
67 * @param[in][out] pReqBufLen IN : pReqBuf Length
68 * OUT : Rights Request Data String Size
69 * (including null terminator)
70 * @param[in][out] pLicenseUrl License Acquisition URL Data
71 * @param[in][out] pLicenseUrlLen IN : IN : pLicenseUrl Length
72 * OUT : Rights Issuer Server URL Data String Size
73 * (including null terminator)
75 * @return TRUE on success or FALSE on failure.
77 * @see DrmTdcGeneratePurchaseRequest()
79 int DrmTdcGenerateLicenseRequest(const char *pRespBuf, unsigned int respBufLen,
80 char *pReqBuf, unsigned int *pReqBufLen, char *pLicenseUrl,
81 unsigned int *pLicenseUrlLen);
84 * An application can get TAD license which is encrypted.
86 * @param[in] pRespBuf Response Data String of the Rights Request
87 * (Null terminator string)
88 * @param[in] respBufLen pResBuf Length
89 * @param[in][out] pDecLicenseBuf Decrypted Rights Object
90 * @param[in][out] decLicenseBufLen IN : pDecLicenseBuf Length
91 * OUT : Decrypted Rights Object String Size
92 * (including null terminator)
94 * @return TRUE on success or FALSE on failure.
96 * @see DrmTdcDecryptPackage()
98 int DrmTdcDecryptLicense(const char *pRespBuf, unsigned int respBufLen,
99 char *pDecLicenseBuf, unsigned int *decLicenseBufLen);
102 * An application can get decrypted contents(Apps) which is encrypted.
104 * @param[in] pTADCFilepath TDC DRM File Path
105 * @param[in] pLicenseBuf pResBuf Length
106 * @param[in] licenseBufLen pDecLicenseBuf Length
107 * @param[in] pDecryptedFile Decrypted File Path
109 * @return TRUE on success or FALSE on failure.
111 * @see DrmTdcDecryptLicense()
113 bool DrmTdcDecryptPackage(const char *pTADCFilepath, const char *pLicenseBuf,
114 unsigned int licenseBufLen, const char *pDecryptedFile);
117 * An application can get decrypted contents(Apps) which is encrypted.
119 * @param[in] pTADCFilepath TDC DRM File Path
120 * @param[in] t_RO Decrypted RO Info
121 * @param[in] pDecryptedFile Decrypted File Path
123 * @return TRUE on success or FALSE on failure.
125 * @see DrmTdcDecryptLicense()
127 bool DrmTdcDecryptPackage2(const char *pTADCFilepath, T_RO t_RO,
128 const char *pDecryptedFile);
131 * An application can check contents(Apps) which is valid.
133 * @param[in] szCid Content ID
135 * @see DrmTdcGetFileHeader()
137 * @return TRUE on success or FALSE on failure.
139 bool DrmTdcHasValidLicense(const char *szCid);
141 //DrmTdcDHInfo Structure Init
142 void DrmTdcDHInfoInit(void);
144 //DrmTdcDHInfo Structure Free
145 bool DrmTdcDHInfoFree(int idx);
147 #endif //__DRMTDCSVC_H_