66 #define LWS_JWS_MAX_SIGS 3
87 struct lws_context *context);
118 struct lws_context *context,
119 char *temp,
int *temp_len);
124 struct lws_context *context,
125 char *temp,
int *temp_len);
148 struct lws_context *context,
149 char *temp,
int *temp_len);
171 struct lws_jwk *jwk,
struct lws_context *context);
217 struct lws_jws_map *map_b64,
char *out,
int *out_len);
222 char *
buf,
int *out_len);
227 struct lws_context *context,
228 char *temp,
int *temp_len);
282 char *temp,
int *temp_len,
const void *in,
size_t in_len,
283 size_t actual_alloc);
308 int idx,
char *temp,
int *temp_len,
size_t random_len,
309 size_t actual_alloc);
332 int *temp_len,
size_t len,
size_t actual_alloc);
355 char *temp,
int *temp_len,
const void *in,
432 const char *alg_list,
const char *com,
size_t len,
433 char *temp,
int tl,
char *out,
size_t *out_len);
457 const char *alg,
char *out,
size_t *out_len,
char *temp,
458 int tl,
const char *format, ...)
LWS_FORMAT(8);
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;
592 lws_jwt_sign_token_set_http_cookie(
struct lws *wsi,
593 const struct lws_jwt_sign_set_cookie *i,
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);
uint32_t len[LWS_JWS_MAX_COMPACT_BLOCKS]
const char * buf[LWS_JWS_MAX_COMPACT_BLOCKS]
struct lws_context * context
struct lws_jws_map map map_b64
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_sig_confirm_compact_b64_map(struct lws_jws_map *map_b64, 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_compact_encode(struct lws_jws_map *map_b64, const struct lws_jws_map *map, char *buf, int *out_len)
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_sig_confirm_json(const char *in, size_t len, struct lws_jws *jws, struct lws_jwk *jwk, struct lws_context *context, char *temp, int *temp_len)
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)
@ LWS_JWS_MAX_COMPACT_BLOCKS
#define LWS_FORMAT(string_index)