TizenRT Public API  v2.0 M2
security_auth.h
1 /****************************************************************************
2  *
3  * Copyright 2019 Samsung Electronics All Rights Reserved.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing,
12  * software distributed under the License is distributed on an
13  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
14  * either express or implied. See the License for the specific
15  * language governing permissions and limitations under the License.
16  *
17  ****************************************************************************/
18 #ifndef _SECURITY_API_AUTH_H__
19 #define _SECURITY_API_AUTH_H__
20 
21 #include "security_common.h"
22 
27 security_error auth_generate_random(security_handle hnd, unsigned int size, security_data *random);
28 
29 security_error auth_generate_certificate(security_handle hnd, const char *cert_name, security_csr *csr, security_data *cert);
30 
31 security_error auth_set_certificate(security_handle hnd, const char *cert_name, security_data *cert);
32 
33 security_error auth_get_certificate(security_handle hnd, const char *cert_name, security_data *cert);
34 
35 security_error auth_remove_certificate(security_handle hnd, const char *cert_name);
36 
37 security_error auth_get_rsa_signature(security_handle hnd, security_rsa_param *param, const char *key_name, security_data *hash, security_data *sign);
38 
39 security_error auth_verify_rsa_signature(security_handle hnd, security_rsa_param *param, const char *key_name, security_data *hash, security_data *sign);
40 
41 security_error auth_get_ecdsa_signature(security_handle hnd, security_ecdsa_param *param, const char *key_name, security_data *hash, security_data *sign);
42 
43 security_error auth_verify_ecdsa_signature(security_handle hnd, security_ecdsa_param *param, const char *key_name, security_data *hash, security_data *sign);
44 
45 security_error auth_get_hash(security_handle hnd, security_hash_mode mode, security_data *data, security_data *hash);
46 
47 security_error auth_get_hmac(security_handle hnd, security_hmac_mode mode, const char *key_name, security_data *data, security_data *hmac);
48 
49 security_error auth_generate_dhparams(security_handle hnd, const char *dh_name, security_dh_param *param);
50 
51 security_error auth_compute_dhparams(security_handle hnd, const char *dh_name, security_dh_param *param, security_data *secret);
52 
53 security_error auth_generate_ecdhkey(security_handle hnd, const char *ecdh_name, security_ecdh_param *param);
54 
55 security_error auth_compute_ecdhkey(security_handle hnd, const char *ecdh_name, security_ecdh_param *param, security_data *secret);
56 
57 #endif // _SECURITY_API_AUTH_H__