KNX IoT
KNX IoT Point API stack implementation
oc_pki.h
Go to the documentation of this file.
1 /*
2 // Copyright (c) 2018 Intel Corporation
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 
28 #ifndef OC_PKI_H
29 #define OC_PKI_H
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 #include <stddef.h>
36 
43 typedef enum {
44  OC_SP_BASELINE = 1 << 1,
45  OC_SP_BLACK = 1 << 2,
46  OC_SP_BLUE = 1 << 3,
47  OC_SP_PURPLE = 1 << 4
49 
66 int oc_pki_add_mfg_cert(size_t device, const unsigned char *cert,
67  size_t cert_size, const unsigned char *key,
68  size_t key_size);
69 
85 int oc_pki_add_mfg_intermediate_cert(size_t device, int credid,
86  const unsigned char *cert,
87  size_t cert_size);
88 
101 int oc_pki_add_mfg_trust_anchor(size_t device, const unsigned char *cert,
102  size_t cert_size);
103 
116 int oc_pki_add_trust_anchor(size_t device, const unsigned char *cert,
117  size_t cert_size);
118 
140 void oc_pki_set_security_profile(size_t device,
141  oc_sp_types_t supported_profiles,
142  oc_sp_types_t current_profile, int mfg_credid);
143 #ifdef __cplusplus
144 }
145 #endif
146 #endif /* OC_PKI_H */
void oc_pki_set_security_profile(size_t device, oc_sp_types_t supported_profiles, oc_sp_types_t current_profile, int mfg_credid)
Set the Security Profile.
oc_sp_types_t
defined security profiles
Definition: oc_pki.h:43
@ OC_SP_BLACK
The Black Security Profile.
Definition: oc_pki.h:45
@ OC_SP_BASELINE
The Baseline Security Profile.
Definition: oc_pki.h:44
@ OC_SP_BLUE
The Blue Security Profile.
Definition: oc_pki.h:46
@ OC_SP_PURPLE
The Purple Security Profile.
Definition: oc_pki.h:47
int oc_pki_add_mfg_cert(size_t device, const unsigned char *cert, size_t cert_size, const unsigned char *key, size_t key_size)
Add the manufactures PKI identity certificate.
int oc_pki_add_mfg_trust_anchor(size_t device, const unsigned char *cert, size_t cert_size)
Add manufacture trust anchor CA.
int oc_pki_add_mfg_intermediate_cert(size_t device, int credid, const unsigned char *cert, size_t cert_size)
Add an intermediate manufacture CA certificate.
int oc_pki_add_trust_anchor(size_t device, const unsigned char *cert, size_t cert_size)
Add trust anchor CA.