42 enum enum_jws_sig_elements {
58 LWS_JWS_MAX_COMPACT_BLOCKS
62 const char *buf[LWS_JWS_MAX_COMPACT_BLOCKS];
63 uint32_t len[LWS_JWS_MAX_COMPACT_BLOCKS];
66 #define LWS_JWS_MAX_SIGS 3
70 struct lws_context *context;
85 LWS_VISIBLE LWS_EXTERN
void
87 struct lws_context *context);
98 LWS_VISIBLE LWS_EXTERN
void
116 LWS_VISIBLE LWS_EXTERN
int
118 struct lws_context *context,
119 char *temp,
int *temp_len);
121 LWS_VISIBLE LWS_EXTERN
int
122 lws_jws_sig_confirm_compact_b64_map(
struct lws_jws_map *map_b64,
124 struct lws_context *context,
125 char *temp,
int *temp_len);
144 LWS_VISIBLE LWS_EXTERN
int
148 struct lws_context *context,
149 char *temp,
int *temp_len);
168 LWS_VISIBLE LWS_EXTERN
int
171 struct lws_jwk *jwk,
struct lws_context *context);
194 LWS_VISIBLE LWS_EXTERN
int
215 LWS_VISIBLE LWS_EXTERN
int
217 struct lws_jws_map *map_b64,
char *out,
int *out_len);
219 LWS_VISIBLE LWS_EXTERN
int
220 lws_jws_compact_encode(
struct lws_jws_map *map_b64,
222 char *buf,
int *out_len);
224 LWS_VISIBLE LWS_EXTERN
int
225 lws_jws_sig_confirm_json(
const char *in,
size_t len,
227 struct lws_context *context,
228 char *temp,
int *temp_len);
238 LWS_VISIBLE LWS_EXTERN
int
249 LWS_VISIBLE LWS_EXTERN
int
280 LWS_VISIBLE LWS_EXTERN
int
282 char *temp,
int *temp_len,
const void *in,
size_t in_len,
283 size_t actual_alloc);
305 LWS_VISIBLE LWS_EXTERN
int
308 int idx,
char *temp,
int *temp_len,
size_t random_len,
309 size_t actual_alloc);
330 LWS_VISIBLE LWS_EXTERN
int
332 int *temp_len,
size_t len,
size_t actual_alloc);
353 LWS_VISIBLE LWS_EXTERN
int
355 char *temp,
int *temp_len,
const void *in,
373 LWS_VISIBLE LWS_EXTERN
int
387 LWS_VISIBLE LWS_EXTERN
int
403 LWS_VISIBLE LWS_EXTERN
int
430 LWS_VISIBLE LWS_EXTERN
int
432 const char *alg_list,
const char *com,
size_t len,
433 char *temp,
int tl,
char *out,
size_t *out_len);
455 LWS_VISIBLE LWS_EXTERN
int
457 const char *alg,
char *out,
size_t *out_len,
char *temp,
458 int tl,
const char *format, ...) LWS_FORMAT(8);
496 LWS_VISIBLE LWS_EXTERN
int
526 LWS_VISIBLE LWS_EXTERN
int
528 const
char *iss, const
char *aud, const
char *csrf_in,
529 char *sub,
size_t sub_len,
unsigned long *exp_unix_time);
531 #if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)
533 struct lws_jwt_sign_set_cookie {
542 const char *cookie_name;
546 const char *extra_json;
549 size_t extra_json_len;
555 unsigned long expiry_unix_time;
591 LWS_VISIBLE LWS_EXTERN
int
592 lws_jwt_sign_token_set_http_cookie(
struct lws *wsi,
593 const struct lws_jwt_sign_set_cookie *i,
594 uint8_t **p, uint8_t *end);
595 LWS_VISIBLE LWS_EXTERN
int
596 lws_jwt_get_http_cookie_validate_jwt(
struct lws *wsi,
597 struct lws_jwt_sign_set_cookie *i,
598 char *out,
size_t *out_len);
LWS_VISIBLE LWS_EXTERN int lws_jws_encode_section(const char *in, size_t in_len, int first, char **p, char *end)
LWS_VISIBLE LWS_EXTERN int lws_jws_sign_from_b64(struct lws_jose *jose, struct lws_jws *jws, char *b64_sig, size_t sig_len)
LWS_VISIBLE LWS_EXTERN int lws_jws_randomize_element(struct lws_context *context, struct lws_jws_map *map, int idx, char *temp, int *temp_len, size_t random_len, size_t actual_alloc)
LWS_VISIBLE LWS_EXTERN int lws_jws_sig_confirm_compact_b64(const char *in, size_t len, struct lws_jws_map *map, struct lws_jwk *jwk, struct lws_context *context, char *temp, int *temp_len)
LWS_VISIBLE LWS_EXTERN int lws_jws_write_compact(struct lws_jws *jws, char *compact, size_t len)
LWS_VISIBLE LWS_EXTERN int lws_jwt_sign_compact(struct lws_context *ctx, struct lws_jwk *jwk, const char *alg, char *out, size_t *out_len, char *temp, int tl, const char *format,...) LWS_FORMAT(8)
LWS_VISIBLE LWS_EXTERN void lws_jws_destroy(struct lws_jws *jws)
LWS_VISIBLE LWS_EXTERN int lws_jws_sig_confirm(struct lws_jws_map *map_b64, struct lws_jws_map *map, struct lws_jwk *jwk, struct lws_context *context)
LWS_VISIBLE LWS_EXTERN int lws_jws_encode_b64_element(struct lws_jws_map *map, int idx, char *temp, int *temp_len, const void *in, size_t in_len)
LWS_VISIBLE LWS_EXTERN int lws_jws_sig_confirm_compact(struct lws_jws_map *map, struct lws_jwk *jwk, struct lws_context *context, char *temp, int *temp_len)
LWS_VISIBLE LWS_EXTERN int lws_jws_alloc_element(struct lws_jws_map *map, int idx, char *temp, int *temp_len, size_t len, size_t actual_alloc)
LWS_VISIBLE LWS_EXTERN int lws_jwt_sign_via_info(struct lws_context *ctx, struct lws_jwk *jwk, const struct lws_jwt_sign_info *info, const char *format,...) LWS_FORMAT(4)
LWS_VISIBLE LWS_EXTERN int lws_jws_dup_element(struct lws_jws_map *map, int idx, char *temp, int *temp_len, const void *in, size_t in_len, size_t actual_alloc)
LWS_VISIBLE LWS_EXTERN int lws_jws_write_flattened_json(struct lws_jws *jws, char *flattened, size_t len)
LWS_VISIBLE LWS_EXTERN int lws_jwt_signed_validate(struct lws_context *ctx, struct lws_jwk *jwk, const char *alg_list, const char *com, size_t len, char *temp, int tl, char *out, size_t *out_len)
LWS_VISIBLE LWS_EXTERN int lws_jws_base64_enc(const char *in, size_t in_len, char *out, size_t out_max)
LWS_VISIBLE LWS_EXTERN int lws_jwt_token_sanity(const char *in, size_t in_len, const char *iss, const char *aud, const char *csrf_in, char *sub, size_t sub_len, unsigned long *exp_unix_time)
LWS_VISIBLE LWS_EXTERN int lws_jws_b64_compact_map(const char *in, int len, struct lws_jws_map *map)
LWS_VISIBLE LWS_EXTERN int lws_jws_compact_decode(const char *in, int len, struct lws_jws_map *map, struct lws_jws_map *map_b64, char *out, int *out_len)
LWS_VISIBLE LWS_EXTERN void lws_jws_init(struct lws_jws *jws, struct lws_jwk *jwk, struct lws_context *context)
Definition: lws-jose.h:116
Definition: lws-jws.h:460
const char * alg
Definition: lws-jws.h:461
size_t jose_hdr_len
Definition: lws-jws.h:466
char * temp
Definition: lws-jws.h:472
size_t * out_len
Definition: lws-jws.h:470
const char * jose_hdr
Definition: lws-jws.h:463
char * out
Definition: lws-jws.h:468
int tl
Definition: lws-jws.h:475