Mistake on this page? Email us
kcm_defs.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // Copyright 2016-2017 ARM Ltd.
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 
17 #ifndef __KCM_DEFS_H__
18 #define __KCM_DEFS_H__
19 
20 #include <stdint.h>
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
34  typedef enum {
42 
44  typedef enum {
45  KCM_MD_NONE = 0x0,
47  } kcm_md_type_e;
48 
50  typedef enum {
51  KCM_CSR_KU_NONE = 0x0,
57 
59  typedef enum {
60  KCM_CSR_EXT_KU_NONE = 0,
61  KCM_CSR_EXT_KU_ANY = (1 << 0),
69 
74  typedef enum {
75  KCM_SCHEME_NONE,
78 
79  /*
80  * Certificate chain handle
81  */
82  typedef void* kcm_cert_chain_handle;
83 
88  typedef uintptr_t kcm_key_handle_t;
89 
94  typedef void* kcm_security_desc_s;
95 
104  typedef struct kcm_csr_params_ {
105  char *subject;
106  kcm_md_type_e md_type;
107  uint32_t key_usage;
108  uint32_t ext_key_usage;
110 
111 
112 #ifdef MBED_CONF_MBED_CLOUD_CLIENT_SECURE_ELEMENT_SUPPORT
113 
117  typedef enum {
118  KCM_LOCATION_PSA = 1,
119  KCM_LOCATION_SECURE_ELEMENT = 2,
120  } kcm_item_location_e;
121 
130  typedef struct kcm_item_extra_info {
131  kcm_item_location_e priv_key_location;
132  kcm_item_location_e pub_key_location;
133  } kcm_item_extra_info_s;
134 
135 #endif // #ifdef MBED_CONF_MBED_CLOUD_CLIENT_SECURE_ELEMENT_SUPPORT
136 
140  #define KCM_MAX_FILENAME_SIZE 100
141 
145  #define KCM_MAX_NUMBER_OF_CERTITICATES_IN_CHAIN 5
146 
150  #define KCM_SHA256_SIZE 32
151 
155  #define KCM_EC_SECP256R1_SIGNATURE_RAW_SIZE 64
156 
160  #define KCM_EC_SECP256R1_SHARED_SECRET_SIZE 32
161 
162 #ifdef __cplusplus
163 }
164 #endif
165 
166 #endif //__KCM_DEFS_H__
kcm_crypto_key_scheme_e
Definition: kcm_defs.h:74
KCM private key item type. KCM Supports ECC keys with curves defined in palGroupIndex_t(pal_Crypto.h)
Definition: kcm_defs.h:35
kcm_csr_ext_key_usage_e
Definition: kcm_defs.h:59
E - mail Protection(S / MIME).
Definition: kcm_defs.h:65
KCM public key item type. KCM Supports ECC keys with curves defined in palGroupIndex_t(pal_Crypto.h)
Definition: kcm_defs.h:36
SSL / TLS Web Server Authentication.
Definition: kcm_defs.h:62
uintptr_t kcm_key_handle_t
Definition: kcm_defs.h:88
OCSP Signing.
Definition: kcm_defs.h:67
Non repudiation key usage extension bit.
Definition: kcm_defs.h:53
void * kcm_security_desc_s
Definition: kcm_defs.h:94
Definition: kcm_defs.h:104
KCM configuration parameter item type.
Definition: kcm_defs.h:39
kcm_item_type_e
Definition: kcm_defs.h:34
Digital signature key usage extension bit.
Definition: kcm_defs.h:52
struct kcm_csr_params_ kcm_csr_params_s
Code signing.
Definition: kcm_defs.h:64
kcm_md_type_e
Definition: kcm_defs.h:44
kcm_csr_key_usage_e
Definition: kcm_defs.h:50
Key agreement key usage extension bit.
Definition: kcm_defs.h:55
KCM ECC cryptographic scheme, 256-bits NIST curve.
Definition: kcm_defs.h:76
KCM symmetric key item type.
Definition: kcm_defs.h:37
KCM certificate item type. Supported x509 certificates in der format.
Definition: kcm_defs.h:38
KCM SHA256 message digest.
Definition: kcm_defs.h:46
SSL / TLS Web Client Authentication.
Definition: kcm_defs.h:63
Trusted Time stamping.
Definition: kcm_defs.h:66
KCM not defined item type.
Definition: kcm_defs.h:40
Certificate signing key usage extension bit.
Definition: kcm_defs.h:54