libwebsockets
Lightweight C library for HTML5 websockets
lws-cose.h
Go to the documentation of this file.
1 /*
2  * libwebsockets - small server side websockets and web server implementation
3  *
4  * Copyright (C) 2010 - 2021 Andy Green <andy@warmcat.com>
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to
8  * deal in the Software without restriction, including without limitation the
9  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10  * sell copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in
14  * all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22  * IN THE SOFTWARE.
23  */
24 
32 
33 enum {
34  /* RFC8152: Table 2: Common Header Parameters
35  * https://www.iana.org/assignments/cose/cose.xhtml#header-parameters
36  */
37 
38  LWSCOSE_WKL_ALG = 1, /* int / tstr */
39  LWSCOSE_WKL_CRIT, /* [+ label ] */
40  LWSCOSE_WKL_CONTENT_TYPE, /* tstr / uint */
41  LWSCOSE_WKL_KID, /* bstr */
42  LWSCOSE_WKL_IV, /* bstr */
44  LWSCOSE_WKL_COUNTERSIG, /* COSE sig(s) */
45  LWSCOSE_WKL_COUNTERSIG0 = 9, /* bstr */
47  LWSCOSE_WKL_CUPH_NONCE = 256, /* bstr */
48  LWSCOSE_WKL_CUPH_OWNER_PUBKEY = 257, /* array */
49 
50  /* RFC8152: Table 3: key map labels */
51 
52  LWSCOSE_WKK_KTY = 1, /* int / tstr */
53  LWSCOSE_WKK_KID, /* bstr */
54  LWSCOSE_WKK_ALG, /* int / tstr */
55  LWSCOSE_WKK_KEY_OPS, /* [ + (int / tstr) ] */
56  LWSCOSE_WKK_BASE_IV, /* bstr */
57 
58  /* RFC8152: Table 4: Key Operation Values */
59 
70 
71  /* RFC8152: Table 5: ECDSA algs */
72 
76 
77  /* RFC8152: Table 6: EDDSA algs */
78 
80 
81  /* RFC8152: Table 7: HMAC algs */
82 
87 
88  /* RFC8152: Table 8: AES algs */
89 
94 
95  /* RFC8152: Table 9: AES GCM algs */
96 
100 
101  /* RFC8152: Table 10: AES CCM algs */
102 
111 
112  /* RFC8152: Table 11: CHACHA20 / Poly1305 */
113 
115 
116  /* RFC8152: Table 13: HKDF param */
117 
119 
120  /* RFC8152: Table 14: Context Algorithm Parameters */
121 
128 
129  /* RFC8152: Table 15: Direct key */
130 
132 
133  /* RFC8152: Table 16: Direct key with KDF */
134 
139 
140  /* RFC8152: Table 17: AES Key Wrap Algorithm Values */
141 
145 
146  /* RFC8152: Table 18: ECDH Algorithm Values */
147 
152 
153  /* RFC8152: Table 19: ECDH Algorithm Parameters */
154 
158 
159  /* RFC8152: Table 20: ECDH Algorithm Parameters with key wrap */
160 
167 
168  /* RFC8152: Table 21: Key Type Values
169  * https://www.iana.org/assignments/cose/cose.xhtml#key-type
170  */
171 
178 
179 
180  /* RFC8152: Table 22: Elliptic Curves
181  * https://www.iana.org/assignments/cose/cose.xhtml#elliptic-curves
182  */
183 
192 
193  /* RFC8152: Table 23: EC Key Parameters */
194 
199 
200  /* RFC8152: Table 24: Octet Key Pair (OKP) Parameters */
201 
205 
206  /* Additional from
207  * https://www.iana.org/assignments/cose/cose.xhtml#key-type-parameters
208  */
209 
222 
223  /* RFC8152: Table 25: Symmetric Key Parameters */
224 
226 
227  /* RFC8152: Table 26: CoAP Content-Formats for COSE */
228 
237 
238  /* RFC8152: Table 27: Header Parameter for CounterSignature0 */
239 
241 
242  /* RFC8812: Table 1: RSASSA-PKCS1-v1_5 Algorithm Values */
243 
244  LWSCOSE_WKARSA_ALG_RS256 = -257, /* + SHA-256 */
245  LWSCOSE_WKARSA_ALG_RS384 = -258, /* + SHA-384 */
246  LWSCOSE_WKARSA_ALG_RS512 = -259, /* + SHA-512 */
247 };
248 
255 
257 };
258 
259 typedef int64_t cose_param_t;
260 
261 LWS_VISIBLE LWS_EXTERN const char *
263 
265 lws_cose_name_to_alg(const char *name);
266 
267 /*
268  * cose_key
269  */
270 
271 typedef struct lws_cose_key {
272  /* key data elements */
274  /* generic meta key elements, like KID */
276  lws_dll2_t list; /* used when part of a set */
281  char private_key; /* nonzero = has private key elements */
283 
284 typedef int (*lws_cose_key_import_callback)(struct lws_cose_key *s, void *user);
285 
304  void *user, const uint8_t *in, size_t len);
305 
316 
330 lws_cose_key_generate(struct lws_context *context, cose_param_t cose_kty,
331  int use_mask, int bits, const char *curve,
332  const uint8_t *kid, size_t kl);
333 
335 lws_cose_key_from_set(lws_dll2_owner_t *set, const uint8_t *kid, size_t kl);
336 
339 
342 
343 /* only available in _DEBUG build */
344 
347 
348 /*
349  * cose_sign
350  */
351 
352 struct lws_cose_validate_context;
353 
354 
359  SIGTYPE_COUNTERSIGNED, /* not yet supported */
360  SIGTYPE_MAC, /* only supported for validation */
362 };
363 
364 /* a list of these result objects is the output of the validation process */
365 
366 typedef struct {
368 
371 
372  int result; /* 0 = validated */
373 
375 
376 enum {
380 };
381 
382 typedef struct {
383  struct lws_cose_validate_context *cps;
384  const uint8_t *ext;
385  size_t xl;
387 
389 typedef int (*lws_cose_validate_pay_cb_t)(struct lws_cose_validate_context *cps,
390  void *opaque, const uint8_t *paychunk,
391  size_t paychunk_len);
392 
394  struct lws_context *cx;
405  void *pay_opaque;
410  void *ext_opaque;
412  size_t ext_len;
415 
427 LWS_VISIBLE LWS_EXTERN struct lws_cose_validate_context *
429 
442 lws_cose_validate_chunk(struct lws_cose_validate_context *cps,
443  const uint8_t *in, size_t in_len, size_t *used_in);
444 
446 lws_cose_validate_results(struct lws_cose_validate_context *cps);
447 
449 lws_cose_validate_destroy(struct lws_cose_validate_context **cps);
450 
451 struct lws_cose_sign_context;
452 
453 #define LCSC_FL_ADD_CBOR_TAG (1 << 0)
454 #define LCSC_FL_ADD_CBOR_PREFER_MAC0 (1 << 1)
455 
457  struct lws_context *cx;
468  void *ext_opaque;
470  size_t ext_len;
476  int flags;
481 
497 LWS_VISIBLE LWS_EXTERN struct lws_cose_sign_context *
499 
501 lws_cose_sign_add(struct lws_cose_sign_context *csc, cose_param_t alg,
502  const lws_cose_key_t *ck);
503 
505 lws_cose_sign_payload_chunk(struct lws_cose_sign_context *csc,
506  const uint8_t *in, size_t in_len);
507 
509 lws_cose_sign_destroy(struct lws_cose_sign_context **csc);
510 
#define LWS_EXTERN
unsigned char uint8_t
#define LWS_VISIBLE
@ LCOSESIGEXTCB_RET_FINISHED
Definition: lws-cose.h:377
@ LCOSESIGEXTCB_RET_AGAIN
Definition: lws-cose.h:378
@ LCOSESIGEXTCB_RET_ERROR
Definition: lws-cose.h:379
int gencrypto_kty
Definition: lws-cose.h:277
const lws_cose_key_t * cose_key
Definition: lws-cose.h:369
struct lws_gencrypto_keyelem meta[LWS_COUNT_COSE_KEY_ELEMENTS]
Definition: lws-cose.h:275
LWS_VISIBLE LWS_EXTERN enum lws_lec_pctx_ret lws_cose_sign_payload_chunk(struct lws_cose_sign_context *csc, const uint8_t *in, size_t in_len)
LWS_VISIBLE LWS_EXTERN cose_param_t lws_cose_name_to_alg(const char *name)
LWS_VISIBLE LWS_EXTERN int lws_cose_validate_chunk(struct lws_cose_validate_context *cps, const uint8_t *in, size_t in_len, size_t *used_in)
enum_cose_key_meta_tok
Definition: lws-cose.h:249
@ COSEKEY_META_KTY
Definition: lws-cose.h:250
@ COSEKEY_META_KID
Definition: lws-cose.h:251
@ LWS_COUNT_COSE_KEY_ELEMENTS
Definition: lws-cose.h:256
@ COSEKEY_META_BASE_IV
Definition: lws-cose.h:253
@ COSEKEY_META_ALG
Definition: lws-cose.h:254
@ COSEKEY_META_KEY_OPS
Definition: lws-cose.h:252
LWS_VISIBLE LWS_EXTERN lws_dll2_owner_t * lws_cose_validate_results(struct lws_cose_validate_context *cps)
LWS_VISIBLE LWS_EXTERN void lws_cose_key_set_destroy(lws_dll2_owner_t *o)
LWS_VISIBLE LWS_EXTERN struct lws_cose_sign_context * lws_cose_sign_create(const lws_cose_sign_create_info_t *info)
struct lws_context * cx
Definition: lws-cose.h:394
LWS_VISIBLE LWS_EXTERN void lws_cose_sign_destroy(struct lws_cose_sign_context **csc)
LWS_VISIBLE LWS_EXTERN int lws_cose_sign_add(struct lws_cose_sign_context *csc, cose_param_t alg, const lws_cose_key_t *ck)
lws_lec_pctx_t * lec
Definition: lws-cose.h:462
LWS_VISIBLE LWS_EXTERN void lws_cose_key_dump(const lws_cose_key_t *ck)
cose_param_t cose_alg
Definition: lws-cose.h:279
int(* lws_cose_sign_ext_pay_cb_t)(lws_cose_sig_ext_pay_t *x)
Definition: lws-cose.h:388
int(* lws_cose_validate_pay_cb_t)(struct lws_cose_validate_context *cps, void *opaque, const uint8_t *paychunk, size_t paychunk_len)
Definition: lws-cose.h:389
LWS_VISIBLE LWS_EXTERN lws_cose_key_t * lws_cose_key_from_set(lws_dll2_owner_t *set, const uint8_t *kid, size_t kl)
LWS_VISIBLE LWS_EXTERN lws_cose_key_t * lws_cose_key_generate(struct lws_context *context, cose_param_t cose_kty, int use_mask, int bits, const char *curve, const uint8_t *kid, size_t kl)
cose_param_t cose_curve
Definition: lws-cose.h:280
char private_key
Definition: lws-cose.h:281
@ LWSCOSE_WKAAES_128_128
Definition: lws-cose.h:92
@ LWSCOSE_WKAPECDH_STATIC_KEY
Definition: lws-cose.h:156
@ LWSCOSE_WKAAESCCM_64_128_128
Definition: lws-cose.h:109
@ LWSCOSE_WKECKP_CRV
Definition: lws-cose.h:195
@ LWSCOSE_WKAECDSA_ALG_ES384
Definition: lws-cose.h:74
@ LWSCOSE_WKAAESCCM_64_64_128
Definition: lws-cose.h:105
@ LWSCOSE_WKKPRSA_D
Definition: lws-cose.h:212
@ LWSCOSE_WKOKP_D
Definition: lws-cose.h:204
@ LWSCOAP_CONTENTFORMAT_COSE_MAC
Definition: lws-cose.h:233
@ LWSCOSE_WKEC_ED25519
Definition: lws-cose.h:189
@ LWSCOSE_WKL_CUPH_NONCE
Definition: lws-cose.h:47
@ LWSCOSE_WKL_KID
Definition: lws-cose.h:41
@ LWSCOSE_WKKPRSA_Q
Definition: lws-cose.h:214
@ LWSCOSE_WKECKP_D
Definition: lws-cose.h:198
@ LWSCOSE_WKKO_UNWRAP_KEY
Definition: lws-cose.h:65
@ LWSCOSE_WKAAESCCM_64_128_256
Definition: lws-cose.h:110
@ LWSCOSE_WKOKP_X
Definition: lws-cose.h:203
@ LWSCOSE_WKK_KTY
Definition: lws-cose.h:52
@ LWSCOAP_CONTENTFORMAT_COSE_KEY_SET
Definition: lws-cose.h:236
@ LWSCOSE_WKAPCTX_PARTY_U_OTHER
Definition: lws-cose.h:124
@ LWSCOSE_WKAPCTX_PARTY_U_NONCE
Definition: lws-cose.h:123
@ LWSCOSE_WKAAESGCM_256
Definition: lws-cose.h:99
@ LWSCOSE_WKL_IV_PARTIAL
Definition: lws-cose.h:43
@ LWSCOSE_WKKO_VERIFY
Definition: lws-cose.h:61
@ LWSCOSE_WKACHACHA_POLY1305
Definition: lws-cose.h:114
@ LWSCOSE_WKAHMAC_256_256
Definition: lws-cose.h:84
@ LWSCOSE_WKKPRSA_OTHER
Definition: lws-cose.h:218
@ LWSCOSE_WKKTV_WALNUTDSA
Definition: lws-cose.h:177
@ LWSCOSE_WKKTV_SYMMETRIC
Definition: lws-cose.h:175
@ LWSCOSE_WKAPECDH_ES_A128KW
Definition: lws-cose.h:161
@ LWSCOSE_WKAAESCCM_16_64_128
Definition: lws-cose.h:103
@ LWSCOSE_WKK_KEY_OPS
Definition: lws-cose.h:55
@ LWSCOSE_WKKPRSA_TI
Definition: lws-cose.h:221
@ LWSCOSE_WKAECDSA_ALG_ES512
Definition: lws-cose.h:75
@ LWSCOSE_WKKPRSA_RI
Definition: lws-cose.h:219
@ LWSCOSE_WKAPECDH_SS_A256KW
Definition: lws-cose.h:166
@ LWSCOSE_WKL_CONTENT_TYPE
Definition: lws-cose.h:40
@ LWSCOSE_WKAAESCCM_16_64_256
Definition: lws-cose.h:104
@ LWSCOSE_WKAPECDH_SS_A128KW
Definition: lws-cose.h:164
@ LWSCOSE_WKK_DIRECT_HKDFKW_SHA_256
Definition: lws-cose.h:142
@ LWSCOSE_WKAPHKDF_SALT
Definition: lws-cose.h:118
@ LWSCOSE_WKARSA_ALG_RS384
Definition: lws-cose.h:245
@ LWSCOSE_WKAPECDH_ES_A192KW
Definition: lws-cose.h:162
@ LWSCOSE_WKAAESGCM_192
Definition: lws-cose.h:98
@ LWSCOAP_CONTENTFORMAT_COSE_ENCRYPT
Definition: lws-cose.h:231
@ LWSCOSE_WKL_CUPH_OWNER_PUBKEY
Definition: lws-cose.h:48
@ LWSCOSE_WKK_DIRECT_HKDF_AES_256
Definition: lws-cose.h:138
@ LWSCOSE_WKKTV_HSS_LMS
Definition: lws-cose.h:176
@ LWSCOSE_WKKO_DERIVE_BITS
Definition: lws-cose.h:67
@ LWSCOSE_WKAAESGCM_128
Definition: lws-cose.h:97
@ LWSCOSE_WKKO_DERIVE_KEY
Definition: lws-cose.h:66
@ LWSCOSE_WKKTV_RSA
Definition: lws-cose.h:174
@ LWSCOSE_WKECKP_Y
Definition: lws-cose.h:197
@ LWSCOSE_WKK_DIRECT_HKDFKW_AES_128
Definition: lws-cose.h:144
@ LWSCOSE_WKAAESCCM_64_64_256
Definition: lws-cose.h:106
@ LWSCOSE_WKAPCTX_PARTY_U_IDENTITY
Definition: lws-cose.h:122
@ LWSCOSE_WKAPCTX_PARTY_V_IDENTITY
Definition: lws-cose.h:125
@ LWSCOSE_WKEC_X25519
Definition: lws-cose.h:187
@ LWSCOSE_WKSYMKP_KEY_VALUE
Definition: lws-cose.h:225
@ LWSCOSE_WKKTV_OKP
Definition: lws-cose.h:172
@ LWSCOSE_WKAPECDH_EPHEMERAL_KEY
Definition: lws-cose.h:155
@ LWSCOAP_CONTENTFORMAT_COSE_SIGN1
Definition: lws-cose.h:230
@ LWSCOSE_WKKPRSA_E
Definition: lws-cose.h:211
@ LWSCOSE_WKAAES_128_64
Definition: lws-cose.h:90
@ LWSCOSE_WKKTV_EC2
Definition: lws-cose.h:173
@ LWSCOSE_WKL_COUNTERSIGNATURE0
Definition: lws-cose.h:240
@ LWSCOSE_WKAPECDH_STATIC_KEY_ID
Definition: lws-cose.h:157
@ LWSCOSE_WKKPRSA_QINV
Definition: lws-cose.h:217
@ LWSCOSE_WKKO_SIGN
Definition: lws-cose.h:60
@ LWSCOSE_WKEC_ED448
Definition: lws-cose.h:190
@ LWSCOSE_WKL_ALG
Definition: lws-cose.h:38
@ LWSCOAP_CONTENTFORMAT_COSE_KEY
Definition: lws-cose.h:235
@ LWSCOSE_WKARSA_ALG_RS512
Definition: lws-cose.h:246
@ LWSCOSE_WKK_DIRECT_HKDF_SHA_256
Definition: lws-cose.h:135
@ LWSCOSE_WKK_DIRECT_HKDFKW_SHA_512
Definition: lws-cose.h:143
@ LWSCOSE_WKECKP_X
Definition: lws-cose.h:196
@ LWSCOSE_WKK_KID
Definition: lws-cose.h:53
@ LWSCOSE_WKAECDH_ALG_ES_HKDF_512
Definition: lws-cose.h:149
@ LWSCOSE_WKKO_MAC_CREATE
Definition: lws-cose.h:68
@ LWSCOSE_WKAAES_256_128
Definition: lws-cose.h:93
@ LWSCOSE_WKKPRSA_DQ
Definition: lws-cose.h:216
@ LWSCOSE_WKL_COUNTERSIG
Definition: lws-cose.h:44
@ LWSCOSE_WKEC_P521
Definition: lws-cose.h:186
@ LWSCOSE_WKKPRSA_DI
Definition: lws-cose.h:220
@ LWSCOSE_WKK_BASE_IV
Definition: lws-cose.h:56
@ LWSCOSE_WKOKP_CRV
Definition: lws-cose.h:202
@ LWSCOSE_WKK_DIRECT_HKDF_AES_128
Definition: lws-cose.h:137
@ LWSCOSE_WKK_DIRECT_CEK
Definition: lws-cose.h:131
@ LWSCOAP_CONTENTFORMAT_COSE_ENCRYPT0
Definition: lws-cose.h:232
@ LWSCOSE_WKL_CRIT
Definition: lws-cose.h:39
@ LWSCOSE_WKAHMAC_384_384
Definition: lws-cose.h:85
@ LWSCOSE_WKL_COUNTERSIG0
Definition: lws-cose.h:45
@ LWSCOSE_WKEC_P256
Definition: lws-cose.h:184
@ LWSCOSE_WKK_DIRECT_HKDF_SHA_512
Definition: lws-cose.h:136
@ LWSCOSE_WKAAESCCM_16_128_256
Definition: lws-cose.h:108
@ LWSCOAP_CONTENTFORMAT_COSE_SIGN
Definition: lws-cose.h:229
@ LWSCOSE_WKKO_ENCRYPT
Definition: lws-cose.h:62
@ LWSCOSE_WKEC_P384
Definition: lws-cose.h:185
@ LWSCOSE_WKAECDSA_ALG_ES256
Definition: lws-cose.h:73
@ LWSCOSE_WKEC_SECP256K1
Definition: lws-cose.h:191
@ LWSCOSE_WKAAES_256_64
Definition: lws-cose.h:91
@ LWSCOSE_WKEC_X448
Definition: lws-cose.h:188
@ LWSCOSE_WKK_ALG
Definition: lws-cose.h:54
@ LWSCOSE_WKAECDH_ALG_SS_HKDF_256
Definition: lws-cose.h:150
@ LWSCOSE_WKAHMAC_256_64
Definition: lws-cose.h:83
@ LWSCOAP_CONTENTFORMAT_COSE_MAC0
Definition: lws-cose.h:234
@ LWSCOSE_WKAECDH_ALG_SS_HKDF_512
Definition: lws-cose.h:151
@ LWSCOSE_WKAHMAC_512_512
Definition: lws-cose.h:86
@ LWSCOSE_WKL_KID_CONTEXT
Definition: lws-cose.h:46
@ LWSCOSE_WKKO_DECRYPT
Definition: lws-cose.h:63
@ LWSCOSE_WKAPCTX_PARTY_V_NONCE
Definition: lws-cose.h:126
@ LWSCOSE_WKAEDDSA_ALG_EDDSA
Definition: lws-cose.h:79
@ LWSCOSE_WKAECDH_ALG_ES_HKDF_256
Definition: lws-cose.h:148
@ LWSCOSE_WKAPCTX_PARTY_V_OTHER
Definition: lws-cose.h:127
@ LWSCOSE_WKKO_MAC_VERIFY
Definition: lws-cose.h:69
@ LWSCOSE_WKAPECDH_ES_A256KW
Definition: lws-cose.h:163
@ LWSCOSE_WKKPRSA_N
Definition: lws-cose.h:210
@ LWSCOSE_WKARSA_ALG_RS256
Definition: lws-cose.h:244
@ LWSCOSE_WKKPRSA_DP
Definition: lws-cose.h:215
@ LWSCOSE_WKL_IV
Definition: lws-cose.h:42
@ LWSCOSE_WKAAESCCM_16_128_128
Definition: lws-cose.h:107
@ LWSCOSE_WKKPRSA_P
Definition: lws-cose.h:213
@ LWSCOSE_WKKO_WRAP_KEY
Definition: lws-cose.h:64
@ LWSCOSE_WKAPECDH_SS_A192KW
Definition: lws-cose.h:165
int64_t cose_param_t
Definition: lws-cose.h:259
lws_cose_sign_ext_pay_cb_t ext_cb
Definition: lws-cose.h:408
enum lws_cose_sig_types sigtype
Definition: lws-cose.h:478
lws_cose_sign_ext_pay_cb_t ext_cb
Definition: lws-cose.h:466
lws_cose_validate_pay_cb_t pay_cb
Definition: lws-cose.h:403
lws_dll2_t list
Definition: lws-cose.h:276
enum lws_cose_sig_types sigtype
Definition: lws-cose.h:399
lws_dll2_owner_t * keyset
Definition: lws-cose.h:396
lws_cose_sig_types
Definition: lws-cose.h:355
@ SIGTYPE_MULTI
Definition: lws-cose.h:357
@ SIGTYPE_MAC0
Definition: lws-cose.h:361
@ SIGTYPE_SINGLE
Definition: lws-cose.h:358
@ SIGTYPE_COUNTERSIGNED
Definition: lws-cose.h:359
@ SIGTYPE_UNKNOWN
Definition: lws-cose.h:356
@ SIGTYPE_MAC
Definition: lws-cose.h:360
struct lws_gencrypto_keyelem e[LWS_GENCRYPTO_MAX_KEYEL_COUNT]
Definition: lws-cose.h:273
struct lws_cose_key lws_cose_key_t
lws_dll2_owner_t * keyset
Definition: lws-cose.h:459
LWS_VISIBLE LWS_EXTERN void lws_cose_key_destroy(lws_cose_key_t **ck)
LWS_VISIBLE LWS_EXTERN void lws_cose_validate_destroy(struct lws_cose_validate_context **cps)
cose_param_t cose_alg
Definition: lws-cose.h:370
struct lws_cose_validate_create_info lws_cose_validate_create_info_t
cose_param_t kty
Definition: lws-cose.h:278
LWS_VISIBLE LWS_EXTERN enum lws_lec_pctx_ret lws_cose_key_export(lws_cose_key_t *ck, lws_lec_pctx_t *ctx, int flags)
LWS_VISIBLE LWS_EXTERN lws_cose_key_t * lws_cose_key_import(lws_dll2_owner_t *pkey_set, lws_cose_key_import_callback cb, void *user, const uint8_t *in, size_t len)
struct lws_context * cx
Definition: lws-cose.h:457
LWS_VISIBLE LWS_EXTERN struct lws_cose_validate_context * lws_cose_validate_create(const lws_cose_validate_create_info_t *info)
int(* lws_cose_key_import_callback)(struct lws_cose_key *s, void *user)
Definition: lws-cose.h:284
const uint8_t * ext
Definition: lws-cose.h:384
struct lws_cose_validate_context * cps
Definition: lws-cose.h:383
LWS_VISIBLE LWS_EXTERN const char * lws_cose_alg_to_name(cose_param_t alg)
struct lws_cose_sign_create_info lws_cose_sign_create_info_t
#define LWS_GENCRYPTO_MAX_KEYEL_COUNT
Definition: lws-gencrypto.h:90
lws_lec_pctx_ret
Definition: lws-lecp.h:303