Filter results by

Older Versions

Older API versions are available as a download. To view, extract the file and open the index.html file in a web browser.

artik_security.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2017 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 
19 #ifndef __ARTIK_SECURITY_H__
20 #define __ARTIK_SECURITY_H__
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 #include "artik_time.h"
27 #include "artik_error.h"
28 #include "artik_types.h"
29 #include "artik_time.h"
30 
50 #define ARTIK_CERT_SN_MAXLEN 20
51 
58 typedef void *artik_security_handle;
59 
65 typedef enum {
69 
77 typedef struct {
91  artik_error(*request) (artik_security_handle * handle);
102  artik_error(*release) (artik_security_handle handle);
123  artik_error(*get_certificate) (artik_security_handle handle,
124  artik_security_certificate_id cert_id, char **cert);
143  artik_error(*get_key_from_cert) (artik_security_handle handle,
144  const char *cert, char **key);
145 
161  artik_error(*get_ca_chain) (artik_security_handle handle,
162  artik_security_certificate_id cert_id, char **chain);
163 
177  artik_error(*get_random_bytes) (artik_security_handle handle,
178  unsigned char *rand, int len);
179 
193  artik_error(*get_certificate_sn) (artik_security_handle handle,
194  artik_security_certificate_id cert_id, unsigned char *sn,
195  unsigned int *len);
196 
210  artik_error(*get_ec_pubkey_from_cert) (const char *cert, char **key);
211 
231  artik_error(*verify_signature_init) (artik_security_handle * handle,
232  const char *signature_pem, const char *root_ca,
233  const artik_time * signing_time_in, artik_time * signing_time_out);
234 
251  artik_error(*verify_signature_update) (artik_security_handle handle,
252  unsigned char *data, unsigned int data_len);
253 
276  artik_error(*verify_signature_final) (artik_security_handle handle);
277 
291  artik_error(*convert_pem_to_der) (const char *pem_data,
292  unsigned char **der_data, int *length);
293 
295 
296 extern const artik_security_module security_module;
297 
298 #ifdef __cplusplus
299 }
300 #endif
301 #endif /* __ARTIK_SECURITY_H__ */
Custom types.
artik_security_certificate_id
Certificate identifier.
Security module operations.
int artik_error
Error type.
Definition: artik_error.h:35
Time storage type.
Definition: artik_time.h:71
Time module definition.
Error codes.
void * artik_security_handle
Security handle type.
Last updated on: