Refine spec file
[platform/core/security/libwebappenc.git] / srcs / crypto_service.h
1 /*
2  *  Copyright (c) 2000 - 2015 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *  Licensed under the Apache License, Version 2.0 (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://www.apache.org/licenses/LICENSE-2.0
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  *
17  * @file        crypto_service.h
18  * @author      Dongsun Lee (ds73.lee@samsung.com)
19  * @version     1.0
20  * @brief       a header for key manupulatation.
21  */
22
23
24
25 #ifndef __TIZEN_CORE_WAE_CRYPTO_SERVICE_H
26 #define __TIZEN_CORE_WAE_CRYPTO_SERVICE_H
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 #include <stddef.h>
33
34
35 int encrypt_app_dek(const unsigned char* rsaPublicKey, size_t pubKeyLen,
36                     const unsigned char* dek, const int dekLen,
37                     unsigned char** encryptedDek, size_t* encryptedDekLen);
38
39 int decrypt_app_dek(const unsigned char* rsaPrivateKey, size_t priKeyLen,
40                     const char* priKeyPassword,
41                     const unsigned char* encryptedDek, size_t dencryptedDekLen,
42                     unsigned char** decryptedDek, size_t* decryptedDekLen);
43
44
45 int encrypt_aes_cbc(const unsigned char* pKey, size_t keyLen,
46                     const unsigned char* pData, size_t dataLen,
47                     unsigned char** ppEncryptedData, size_t* pEncDataLen);
48
49 int decrypt_aes_cbc(const unsigned char* pKey, size_t keyLen,
50                     const unsigned char* pData, size_t dataLen,
51                     unsigned char** ppDecryptedData, size_t* pDecDataLen);
52
53 #ifdef __cplusplus
54 }
55 #endif
56 #endif /* __TIZEN_CORE_WAE_CRYPTO_SERVICE_H */
57