2 * Copyright (c) 2000 - 2014 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
17 * @file ckmc-manager.h
18 * @author Yuseok Jeon(yuseok.jeon@samsung.com)
20 * @brief provides management functions(storing, retrieving, and removing) for keys, certificates and data of a user and additional crypto functions.
24 #ifndef CKMC_MANAGER_H
25 #define CKMC_MANAGER_H
28 #include <sys/types.h>
29 #include <ckmc/ckmc-type.h>
35 // key related functions
36 int ckm_save_key(const char *alias, const ckm_key key, const ckm_policy policy);
37 int ckm_remove_key(const char *alias);
38 int ckm_get_key(const char *alias, const char *password, ckm_key **key);
39 int ckm_get_key_alias_list(ckm_alias_list** alias_list);
41 int ckm_save_cert(const char *alias, const ckm_cert cert, const ckm_policy policy);
42 int ckm_remove_cert(const char *alias);
43 int ckm_get_cert(const char *alias, const char *password, const ckm_cert **cert);
44 int ckm_get_cert_alias_list(ckm_alias_list** alias_list);
46 int ckm_save_data(const char *alias, ckm_raw_buffer data, const ckm_policy policy);
47 int ckm_remove_data(const char *alias);
48 int ckm_get_data(const char *alias, const char *password, ckm_raw_buffer **data);
49 int ckm_get_data_alias_list(ckm_alias_list** alias_list);
53 int ckm_create_key_pair_rsa(const size_t size, const char *private_key_alias, const char *public_key_alias, const ckm_policy policy_private_key, const ckm_policy policy_public_key);
54 int ckm_create_key_pair_ecdsa(const ckm_ec_type type, const char *private_key_alias, const char *public_key_alias, const ckm_policy policy_private_key, const ckm_policy policy_public_key);
55 int ckm_create_signature(const char *private_key_alias, const char *password, const ckm_raw_buffer message, const ckm_hash_algo hash, const ckm_rsa_padding_algo padding, ckm_raw_buffer **signature);
56 int ckm_verify_signature(const char *public_key_alias, const char *password, const ckm_raw_buffer message, const ckm_raw_buffer signature, const ckm_hash_algo hash, const ckm_rsa_padding_algo padding);
58 int ckm_get_cert_chain(const ckm_cert *cert, const ckm_cert_list *untrustedcerts, ckm_cert_list **cert_chain_list);
59 int ckm_get_cert_chain_with_alias(const ckm_cert *cert, const ckm_alias_list *untrustedcerts, ckm_cert_list **cert_chain_list);
67 #endif /* CKMC_MANAGER_H */