1d4afb5ceSopenharmony_ci/* 2d4afb5ceSopenharmony_ci * libwebsockets - small server side websockets and web server implementation 3d4afb5ceSopenharmony_ci * 4d4afb5ceSopenharmony_ci * Copyright (C) 2010 - 2019 Andy Green <andy@warmcat.com> 5d4afb5ceSopenharmony_ci * 6d4afb5ceSopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a copy 7d4afb5ceSopenharmony_ci * of this software and associated documentation files (the "Software"), to 8d4afb5ceSopenharmony_ci * deal in the Software without restriction, including without limitation the 9d4afb5ceSopenharmony_ci * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 10d4afb5ceSopenharmony_ci * sell copies of the Software, and to permit persons to whom the Software is 11d4afb5ceSopenharmony_ci * furnished to do so, subject to the following conditions: 12d4afb5ceSopenharmony_ci * 13d4afb5ceSopenharmony_ci * The above copyright notice and this permission notice shall be included in 14d4afb5ceSopenharmony_ci * all copies or substantial portions of the Software. 15d4afb5ceSopenharmony_ci * 16d4afb5ceSopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17d4afb5ceSopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18d4afb5ceSopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19d4afb5ceSopenharmony_ci * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20d4afb5ceSopenharmony_ci * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21d4afb5ceSopenharmony_ci * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22d4afb5ceSopenharmony_ci * IN THE SOFTWARE. 23d4afb5ceSopenharmony_ci */ 24d4afb5ceSopenharmony_ci 25d4afb5ceSopenharmony_ci/* information about each token declared above */ 26d4afb5ceSopenharmony_ci 27d4afb5ceSopenharmony_ci#define F_M (1 << 9) /* Mandatory for key type */ 28d4afb5ceSopenharmony_ci#define F_B64 (1 << 10) /* Base64 coded octets */ 29d4afb5ceSopenharmony_ci#define F_B64U (1 << 11) /* Base64 Url coded octets */ 30d4afb5ceSopenharmony_ci#define F_META (1 << 12) /* JWK key metainformation */ 31d4afb5ceSopenharmony_ci#define F_RSA (1 << 13) /* RSA key */ 32d4afb5ceSopenharmony_ci#define F_EC (1 << 14) /* Elliptic curve key */ 33d4afb5ceSopenharmony_ci#define F_OCT (1 << 15) /* octet key */ 34d4afb5ceSopenharmony_ci 35d4afb5ceSopenharmony_civoid 36d4afb5ceSopenharmony_cilws_jwk_destroy_elements(struct lws_gencrypto_keyelem *el, int m); 37d4afb5ceSopenharmony_ci 38d4afb5ceSopenharmony_ciint 39d4afb5ceSopenharmony_cilws_jose_render(struct lws_jose *jose, struct lws_jwk *aux_jwk, 40d4afb5ceSopenharmony_ci char *out, size_t out_len); 41d4afb5ceSopenharmony_ci 42d4afb5ceSopenharmony_ciint 43d4afb5ceSopenharmony_ci_lws_jwk_set_el_jwk(struct lws_gencrypto_keyelem *e, char *in, size_t len); 44d4afb5ceSopenharmony_ci 45d4afb5ceSopenharmony_civoid 46d4afb5ceSopenharmony_cilws_jwk_init_jps(struct lws_jwk_parse_state *jps, 47d4afb5ceSopenharmony_ci struct lws_jwk *jwk, lws_jwk_key_import_callback cb, 48d4afb5ceSopenharmony_ci void *user); 49d4afb5ceSopenharmony_ci 50d4afb5ceSopenharmony_cisigned char 51d4afb5ceSopenharmony_cicb_jwk(struct lejp_ctx *ctx, char reason); 52d4afb5ceSopenharmony_ci 53d4afb5ceSopenharmony_ciextern const char * const jwk_tok[19], * const jwk_outer_tok[19]; 54