2 * Copyright (c) 2017-2022 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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
18 * @author isaac2.lee (isaac2.lee@samsung.com)
23 #include <ckm/ckm-type.h>
24 #include <data-type.h>
25 #include <generic-backend/gstore.h>
32 void generateSKey(const CryptoAlgorithm &alg, const uint32_t key_idx);
34 void generateAKey(const CryptoAlgorithm &alg, const uint32_t key_idx);
36 // encrypt key data using SE api
37 RawBuffer encryptWithDbpKey(const unsigned char* key, const uint32_t key_len,
38 const unsigned char* iv, const uint32_t iv_len);
40 RawBuffer symmetricEncrypt(const uint32_t key_idx,
41 const CryptoAlgorithm &alg,
43 RawBuffer symmetricDecrypt(const uint32_t key_idx,
44 const CryptoAlgorithm &alg,
47 RawBuffer asymmetricEncrypt(const uint32_t key_idx,
48 const CryptoAlgorithm &alg,
51 RawBuffer asymmetricDecrypt(const uint32_t key_idx,
52 const CryptoAlgorithm &alg,
55 RawBuffer sign(const uint32_t key_idx, const CryptoAlgorithm &alg,
58 int verify(const uint32_t key_idx, const CryptoAlgorithm &alg,
59 RawBuffer &hash, RawBuffer &signature);
61 } // namespace Internals