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);
192 LWS_VISIBLE LWS_EXTERN
int
213 LWS_VISIBLE LWS_EXTERN
int
215 struct lws_jws_map *map_b64,
char *out,
int *out_len);
217 LWS_VISIBLE LWS_EXTERN
int
218 lws_jws_compact_encode(
struct lws_jws_map *map_b64,
220 char *buf,
int *out_len);
222 LWS_VISIBLE LWS_EXTERN
int
223 lws_jws_sig_confirm_json(
const char *in,
size_t len,
225 struct lws_context *context,
226 char *temp,
int *temp_len);
236 LWS_VISIBLE LWS_EXTERN
int
247 LWS_VISIBLE LWS_EXTERN
int
278 LWS_VISIBLE LWS_EXTERN
int
280 char *temp,
int *temp_len,
const void *in,
size_t in_len,
281 size_t actual_alloc);
303 LWS_VISIBLE LWS_EXTERN
int
306 int idx,
char *temp,
int *temp_len,
size_t random_len,
307 size_t actual_alloc);
328 LWS_VISIBLE LWS_EXTERN
int
330 int *temp_len,
size_t len,
size_t actual_alloc);
351 LWS_VISIBLE LWS_EXTERN
int
353 char *temp,
int *temp_len,
const void *in,
371 LWS_VISIBLE LWS_EXTERN
int
385 LWS_VISIBLE LWS_EXTERN
int
401 LWS_VISIBLE LWS_EXTERN
int
428 LWS_VISIBLE LWS_EXTERN
int
430 const char *alg_list,
const char *com,
size_t len,
431 char *temp,
int tl,
char *out,
size_t *out_len);
453 LWS_VISIBLE LWS_EXTERN
int
455 const char *alg,
char *out,
size_t *out_len,
char *temp,
456 int tl,
const char *format, ...) LWS_FORMAT(8);
494 LWS_VISIBLE LWS_EXTERN
int
524 LWS_VISIBLE LWS_EXTERN
int
526 const
char *iss, const
char *aud, const
char *csrf_in,
527 char *sub,
size_t sub_len,
unsigned long *exp_unix_time);
529 #if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)
531 struct lws_jwt_sign_set_cookie {
540 const char *cookie_name;
544 const char *extra_json;
547 size_t extra_json_len;
553 unsigned long expiry_unix_time;
589 LWS_VISIBLE LWS_EXTERN
int
590 lws_jwt_sign_token_set_http_cookie(
struct lws *wsi,
591 const struct lws_jwt_sign_set_cookie *i,
592 uint8_t **p, uint8_t *end);
593 LWS_VISIBLE LWS_EXTERN
int
594 lws_jwt_get_http_cookie_validate_jwt(
struct lws *wsi,
595 struct lws_jwt_sign_set_cookie *i,
596 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:458
const char * alg
Definition: lws-jws.h:459
size_t jose_hdr_len
Definition: lws-jws.h:464
char * temp
Definition: lws-jws.h:470
size_t * out_len
Definition: lws-jws.h:468
const char * jose_hdr
Definition: lws-jws.h:461
char * out
Definition: lws-jws.h:466
int tl
Definition: lws-jws.h:473