33 #define LWS_JWE_RFC3394_OVERHEAD_BYTES 8
34 #define LWS_JWE_AES_IV_BYTES 16
36 #define LWS_JWE_LIMIT_RSA_KEY_BITS 4096
37 #define LWS_JWE_LIMIT_AES_KEY_BITS (512 + 64)
38 #define LWS_JWE_LIMIT_EC_KEY_BITS 528
39 #define LWS_JWE_LIMIT_HASH_BITS (LWS_GENHASH_LARGEST * 8)
42 #define LWS_JWE_LIMIT_KEY_ELEMENT_BYTES (LWS_JWE_LIMIT_RSA_KEY_BITS / 8)
54 uint8_t cek[LWS_JWE_LIMIT_KEY_ELEMENT_BYTES];
55 unsigned int cek_valid:1;
60 LWS_VISIBLE LWS_EXTERN
void
61 lws_jwe_init(
struct lws_jwe *jwe,
struct lws_context *context);
63 LWS_VISIBLE LWS_EXTERN
void
64 lws_jwe_destroy(
struct lws_jwe *jwe);
66 LWS_VISIBLE LWS_EXTERN
void
67 lws_jwe_be64(uint64_t c, uint8_t *p8);
79 LWS_VISIBLE LWS_EXTERN
int
80 lws_jwe_render_compact(
struct lws_jwe *jwe,
char *out,
size_t out_len);
83 lws_jwe_render_flattened(
struct lws_jwe *jwe,
char *out,
size_t out_len);
85 LWS_VISIBLE LWS_EXTERN
int
86 lws_jwe_json_parse(
struct lws_jwe *jwe,
const uint8_t *buf,
int len,
87 char *temp,
int *temp_len);
112 LWS_VISIBLE LWS_EXTERN
int
113 lws_jwe_auth_and_decrypt(
struct lws_jwe *jwe,
char *temp,
int *temp_len);
128 LWS_VISIBLE LWS_EXTERN
int
129 lws_jwe_encrypt(
struct lws_jwe *jwe,
char *temp,
int *temp_len);
150 LWS_VISIBLE LWS_EXTERN
int
151 lws_jwe_create_packet(
struct lws_jwe *jwe,
152 const char *payload,
size_t len,
const char *nonce,
153 char *out,
size_t out_len,
struct lws_context *context);
157 LWS_VISIBLE LWS_EXTERN
int
158 lws_jwe_auth_and_decrypt_cbc_hs(
struct lws_jwe *jwe, uint8_t *enc_cek,
159 uint8_t *aad,
int aad_len);
162 LWS_VISIBLE LWS_EXTERN
int
163 lws_jwa_concat_kdf(
struct lws_jwe *jwe,
int direct,
164 uint8_t *out,
const uint8_t *shared_secret,
int sslen);
Definition: lws-jose.h:116