libwebsockets
Lightweight C library for HTML5 websockets
lws-jws.h File Reference

Go to the source code of this file.

Data Structures

struct  lws_jws_map
 
struct  lws_jws
 
struct  lws_jwt_sign_info
 

Macros

#define LWS_JWS_MAX_SIGS   3
 

Enumerations

enum  enum_jws_sig_elements {
  LJWS_JOSE , LJWS_PYLD , LJWS_SIG , LJWS_UHDR ,
  LJWE_JOSE = 0 , LJWE_EKEY , LJWE_IV , LJWE_CTXT ,
  LJWE_ATAG , LJWE_AAD , LWS_JWS_MAX_COMPACT_BLOCKS
}
 

Functions

LWS_VISIBLE LWS_EXTERN void lws_jws_init (struct lws_jws *jws, struct lws_jwk *jwk, struct lws_context *context)
 
LWS_VISIBLE LWS_EXTERN void lws_jws_destroy (struct lws_jws *jws)
 
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_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_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 (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_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_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 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_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_jws_write_compact (struct lws_jws *jws, char *compact, size_t len)
 
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_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_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_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_b64_compact_map (const char *in, int len, struct lws_jws_map *map)
 
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_jws_encode_section (const char *in, size_t in_len, int first, char **p, char *end)
 
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_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 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_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)