Rhonabwy
Javascript Object Signing and Encryption (JOSE) library - JWK, JWKS, JWS, JWE and JWT
rhonabwy.h
Go to the documentation of this file.
1
25#ifndef __RHONABWY_H_
26#define __RHONABWY_H_
27
28#ifdef __cplusplus
29extern "C"
30{
31#endif
32
33#include "rhonabwy-cfg.h"
34
35#include <stdint.h>
36#include <jansson.h>
37#include <gnutls/gnutls.h>
38#include <nettle/version.h>
39
46#define RHN_OK 0
47#define RHN_ERROR 1
48#define RHN_ERROR_MEMORY 2
49#define RHN_ERROR_PARAM 3
50#define RHN_ERROR_UNSUPPORTED 4
51#define RHN_ERROR_INVALID 5
52
53#define R_X509_TYPE_UNSPECIFIED 0
54#define R_X509_TYPE_PUBKEY 1
55#define R_X509_TYPE_PRIVKEY 2
56#define R_X509_TYPE_CERTIFICATE 3
57
58#define R_FORMAT_PEM 0
59#define R_FORMAT_DER 1
60
61#define R_KEY_TYPE_NONE 0x00000000
62#define R_KEY_TYPE_PUBLIC 0x00000001
63#define R_KEY_TYPE_PRIVATE 0x00000010
64#define R_KEY_TYPE_SYMMETRIC 0x00000100
65#define R_KEY_TYPE_RSA 0x00001000
66#define R_KEY_TYPE_EC 0x00010000
67#define R_KEY_TYPE_HMAC 0x00100000
68#define R_KEY_TYPE_EDDSA 0x01000000
69#define R_KEY_TYPE_ECDH 0x10000000
70
71#define R_FLAG_IGNORE_SERVER_CERTIFICATE 0x00000001
72#define R_FLAG_FOLLOW_REDIRECT 0x00000010
73#define R_FLAG_IGNORE_REMOTE 0x00000100
74
75#define R_JWT_TYPE_NONE 0
76#define R_JWT_TYPE_SIGN 1
77#define R_JWT_TYPE_ENCRYPT 2
78#define R_JWT_TYPE_NESTED_SIGN_THEN_ENCRYPT 3
79#define R_JWT_TYPE_NESTED_ENCRYPT_THEN_SIGN 4
80
81#define R_JWT_CLAIM_NOW -1
82#define R_JWT_CLAIM_PRESENT -2
83
84#define R_JWK_THUMB_SHA256 0
85#define R_JWK_THUMB_SHA384 1
86#define R_JWK_THUMB_SHA512 2
87
88#define R_JSON_MODE_COMPACT 0
89#define R_JSON_MODE_GENERAL 1
90#define R_JSON_MODE_FLATTENED 2
91
92#define R_PARSE_NONE 0
93#define R_PARSE_HEADER_JWK 1
94#define R_PARSE_HEADER_JKU 2
95#define R_PARSE_HEADER_X5C 4
96#define R_PARSE_HEADER_X5U 8
97#define R_PARSE_HEADER_ALL (R_PARSE_HEADER_JWK|R_PARSE_HEADER_JKU|R_PARSE_HEADER_X5C|R_PARSE_HEADER_X5U)
98#define R_PARSE_UNSIGNED 16
99#define R_PARSE_ALL (R_PARSE_HEADER_ALL|R_PARSE_UNSIGNED)
100
111typedef json_t jwk_t;
112typedef json_t jwks_t;
113typedef json_int_t rhn_int_t;
114
115#define RHONABWY_INTEGER_FORMAT JSON_INTEGER_FORMAT
116
117typedef enum {
152
153typedef enum {
169
170typedef enum {
179
180typedef enum {
228
229typedef enum {
241 R_IMPORT_JKU = 11
243
244typedef struct {
245 unsigned char * header_b64url;
246 unsigned char * payload_b64url;
247 unsigned char * signature_b64url;
248 json_t * j_header;
252 unsigned char * payload;
256} jws_t;
257
258typedef struct {
259 unsigned char * header_b64url;
260 unsigned char * encrypted_key_b64url;
261 unsigned char * aad_b64url;
262 unsigned char * iv_b64url;
263 unsigned char * ciphertext_b64url;
264 unsigned char * auth_tag_b64url;
265 json_t * j_header;
271 unsigned char * aad;
272 size_t aad_len;
273 unsigned char * key;
274 size_t key_len;
275 unsigned char * iv;
276 size_t iv_len;
277 unsigned char * payload;
281} jwe_t;
282
283typedef struct {
284 int type;
285 uint32_t parse_flags;
286 json_t * j_header;
287 json_t * j_claims;
293 unsigned char * key;
294 size_t key_len;
295 unsigned char * iv;
296 size_t iv_len;
301} jwt_t;
302
320int r_global_init(void);
321
325void r_global_close(void);
326
334json_t * r_library_info_json_t(void);
335
343char * r_library_info_json_str(void);
344
350void r_free(void * data);
351
357int r_jwk_init(jwk_t ** jwk);
358
363void r_jwk_free(jwk_t * jwk);
364
370int r_jwks_init(jwks_t ** jwks);
371
376void r_jwks_free(jwks_t * jwks);
377
383int r_jws_init(jws_t ** jws);
384
389void r_jws_free(jws_t * jws);
390
396int r_jwe_init(jwe_t ** jwe);
397
402void r_jwe_free(jwe_t * jwe);
403
409int r_jwt_init(jwt_t ** jwt);
410
415void r_jwt_free(jwt_t * jwt);
416
422jwa_alg r_str_to_jwa_alg(const char * alg);
423
430const char * r_jwa_alg_to_str(jwa_alg alg);
431
437jwa_enc r_str_to_jwa_enc(const char * enc);
438
445const char * r_jwa_enc_to_str(jwa_enc enc);
446
482int r_jwk_key_type(jwk_t * jwk, unsigned int * bits, int x5u_flags);
483
490int r_jwk_is_valid(jwk_t * jwk);
491
504int r_jwk_is_valid_x5u(jwk_t * jwk, int x5u_flags);
505
517int r_jwk_generate_key_pair(jwk_t * jwk_privkey, jwk_t * jwk_pubkey, int type, unsigned int bits, const char * kid);
518
535const char * r_jwk_get_property_str(jwk_t * jwk, const char * key);
536
544const char * r_jwk_get_property_array(jwk_t * jwk, const char * key, size_t index);
545
552int r_jwk_get_property_array_size(jwk_t * jwk, const char * key);
553
562int r_jwk_set_property_str(jwk_t * jwk, const char * key, const char * value);
563
573int r_jwk_set_property_array(jwk_t * jwk, const char * key, size_t index, const char * value);
574
583int r_jwk_append_property_array(jwk_t * jwk, const char * key, const char * value);
584
592int r_jwk_delete_property_str(jwk_t * jwk, const char * key);
593
602int r_jwk_delete_property_array_at(jwk_t * jwk, const char * key, size_t index);
603
613int r_jwk_append_x5c(jwk_t * jwk, int format, const unsigned char * input, size_t input_len);
614
632int r_jwk_import_from_json_str(jwk_t * jwk, const char * input);
633
641int r_jwk_import_from_json_t(jwk_t * jwk, json_t * j_input);
642
653int r_jwk_import_from_pem_der(jwk_t * jwk, int type, int format, const unsigned char * input, size_t input_len);
654
662int r_jwk_import_from_gnutls_privkey(jwk_t * jwk, gnutls_privkey_t key);
663
671int r_jwk_import_from_gnutls_pubkey(jwk_t * jwk, gnutls_pubkey_t pub);
672
680int r_jwk_import_from_gnutls_x509_crt(jwk_t * jwk, gnutls_x509_crt_t crt);
681
693int r_jwk_import_from_x5u(jwk_t * jwk, int x5u_flags, const char * x5u);
694
702int r_jwk_import_from_x5c(jwk_t * jwk, const char * x5c);
703
712int r_jwk_import_from_symmetric_key(jwk_t * jwk, const unsigned char * key, size_t key_len);
713
721int r_jwk_import_from_password(jwk_t * jwk, const char * password);
722
735int r_jwk_extract_pubkey(jwk_t * jwk_privkey, jwk_t * jwk_pubkey, int x5u_flags);
736
746
752jwk_t * r_jwk_copy(jwk_t * jwk);
753
760int r_jwk_equal(jwk_t * jwk1, jwk_t * jwk2);
761
778char * r_jwk_export_to_json_str(jwk_t * jwk, int pretty);
779
785json_t * r_jwk_export_to_json_t(jwk_t * jwk);
786
792gnutls_privkey_t r_jwk_export_to_gnutls_privkey(jwk_t * jwk);
793
805gnutls_pubkey_t r_jwk_export_to_gnutls_pubkey(jwk_t * jwk, int x5u_flags);
806
820gnutls_x509_crt_t r_jwk_export_to_gnutls_crt(jwk_t * jwk, int x5u_flags);
821
837int r_jwk_export_to_pem_der(jwk_t * jwk, int format, unsigned char * output, size_t * output_len, int x5u_flags);
838
847int r_jwk_export_to_symmetric_key(jwk_t * jwk, unsigned char * key, size_t * key_len);
848
865char * r_jwk_thumbprint(jwk_t * jwk, int hash, int x5u_flags);
866
879int r_jwk_validate_x5c_chain(jwk_t * jwk, int x5u_flags);
880
895int r_jwk_match_json_t(jwk_t * jwk, json_t * j_match);
896
911int r_jwk_match_json_str(jwk_t * jwk, const char * str_match);
912
930int r_jwks_is_valid(jwks_t * jwks);
931
941int r_jwks_import_from_json_str(jwks_t * jwks, const char * input);
942
952int r_jwks_import_from_json_t(jwks_t * jwks, json_t * j_input);
953
967int r_jwks_import_from_uri(jwks_t * jwks, const char * uri, int x5u_flags);
968
979
985jwks_t * r_jwks_copy(jwks_t * jwks);
986
992size_t r_jwks_size(jwks_t * jwks);
993
1001jwk_t * r_jwks_get_at(jwks_t * jwks, size_t index);
1002
1010jwk_t * r_jwks_get_by_kid(jwks_t * jwks, const char * kid);
1011
1018int r_jwks_append_jwk(jwks_t * jwks, jwk_t * jwk);
1019
1027int r_jwks_set_at(jwks_t * jwks, size_t index, jwk_t * jwk);
1028
1035int r_jwks_remove_at(jwks_t * jwks, size_t index);
1036
1042int r_jwks_empty(jwks_t * jwks);
1043
1051int r_jwks_equal(jwks_t * jwks1, jwks_t * jwks2);
1052
1059char * r_jwks_export_to_json_str(jwks_t * jwks, int pretty);
1060
1066json_t * r_jwks_export_to_json_t(jwks_t * jwks);
1067
1075gnutls_privkey_t * r_jwks_export_to_gnutls_privkey(jwks_t * jwks, size_t * len);
1076
1089gnutls_pubkey_t * r_jwks_export_to_gnutls_pubkey(jwks_t * jwks, size_t * len, int x5u_flags);
1090
1106int r_jwks_export_to_pem_der(jwks_t * jwks, int format, unsigned char * output, size_t * output_len, int x5u_flags);
1107
1120jwks_t * r_jwks_search_json_t(jwks_t * jwks, json_t * j_match);
1121
1134jwks_t * r_jwks_search_json_str(jwks_t * jwks, const char * str_match);
1135
1151int r_jws_set_properties(jws_t * jws, ...);
1152
1158jws_t * r_jws_copy(jws_t * jws);
1159
1167int r_jws_set_payload(jws_t * jws, const unsigned char * payload, size_t payload_len);
1168
1175const unsigned char * r_jws_get_payload(jws_t * jws, size_t * payload_len);
1176
1183int r_jws_set_alg(jws_t * jws, jwa_alg alg);
1184
1191
1198const char * r_jws_get_kid(jws_t * jws);
1199
1207int r_jws_set_header_str_value(jws_t * jws, const char * key, const char * str_value);
1208
1216int r_jws_set_header_int_value(jws_t * jws, const char * key, rhn_int_t i_value);
1217
1225int r_jws_set_header_json_t_value(jws_t * jws, const char * key, json_t * j_value);
1226
1233int r_jws_set_full_header_json_t(jws_t * jws, json_t * j_value);
1234
1241int r_jws_set_full_header_json_str(jws_t * jws, const char * str_value);
1242
1249const char * r_jws_get_header_str_value(jws_t * jws, const char * key);
1250
1257rhn_int_t r_jws_get_header_int_value(jws_t * jws, const char * key);
1258
1265json_t * r_jws_get_header_json_t_value(jws_t * jws, const char * key);
1266
1272json_t * r_jws_get_full_header_json_t(jws_t * jws);
1273
1279char * r_jws_get_full_header_str(jws_t * jws);
1280
1288int r_jws_add_keys(jws_t * jws, jwk_t * jwk_privkey, jwk_t * jwk_pubkey);
1289
1297int r_jws_add_jwks(jws_t * jws, jwks_t * jwks_privkey, jwks_t * jwks_pubkey);
1298
1307int r_jws_add_keys_json_str(jws_t * jws, const char * privkey, const char * pubkey);
1308
1317int r_jws_add_keys_json_t(jws_t * jws, json_t * privkey, json_t * pubkey);
1318
1330int r_jws_add_keys_pem_der(jws_t * jws, int format, const unsigned char * privkey, size_t privkey_len, const unsigned char * pubkey, size_t pubkey_len);
1331
1340int r_jws_add_keys_gnutls(jws_t * jws, gnutls_privkey_t privkey, gnutls_pubkey_t pubkey);
1341
1349int r_jws_add_key_symmetric(jws_t * jws, const unsigned char * key, size_t key_len);
1350
1357
1364
1377int r_jws_parse(jws_t * jws, const char * jws_str, int x5u_flags);
1378
1392int r_jws_parsen(jws_t * jws, const char * jws_str, size_t jws_str_len, int x5u_flags);
1393
1416int r_jws_advanced_parse(jws_t * jws, const char * jws_str, uint32_t parse_flags, int x5u_flags);
1417
1441int r_jws_advanced_parsen(jws_t * jws, const char * jws_str, size_t jws_str_len, uint32_t parse_flags, int x5u_flags);
1442
1456int r_jws_parse_unsecure(jws_t * jws, const char * jws_str, int x5u_flags);
1457
1472int r_jws_parsen_unsecure(jws_t * jws, const char * jws_str, size_t jws_str_len, int x5u_flags);
1473
1486int r_jws_compact_parse(jws_t * jws, const char * jws_str, int x5u_flags);
1487
1511int r_jws_advanced_compact_parsen(jws_t * jws, const char * jws_str, size_t jws_str_len, uint32_t parse_flags, int x5u_flags);
1512
1535int r_jws_advanced_compact_parse(jws_t * jws, const char * jws_str, uint32_t parse_flags, int x5u_flags);
1536
1550int r_jws_compact_parsen(jws_t * jws, const char * jws_str, size_t jws_str_len, int x5u_flags);
1551
1566int r_jws_compact_parsen_unsecure(jws_t * jws, const char * jws_str, size_t jws_str_len, int x5u_flags);
1567
1581int r_jws_compact_parse_unsecure(jws_t * jws, const char * jws_str, int x5u_flags);
1582
1595int r_jws_parse_json_str(jws_t * jws, const char * jws_json_str, int x5u_flags);
1596
1610int r_jws_parsen_json_str(jws_t * jws, const char * jws_json_str, size_t jws_json_str_len, int x5u_flags);
1611
1624int r_jws_parse_json_t(jws_t * jws, json_t * jws_json, int x5u_flags);
1625
1648int r_jws_advanced_parse_json_str(jws_t * jws, const char * jws_json_str, uint32_t parse_flags, int x5u_flags);
1649
1673int r_jws_advanced_parsen_json_str(jws_t * jws, const char * jws_json_str, size_t jws_json_str_len, uint32_t parse_flags, int x5u_flags);
1674
1697int r_jws_advanced_parse_json_t(jws_t * jws, json_t * jws_json, uint32_t parse_flags, int x5u_flags);
1698
1720jws_t * r_jws_quick_parse(const char * jws_str, uint32_t parse_flags, int x5u_flags);
1721
1744jws_t * r_jws_quick_parsen(const char * jws_str, size_t jws_str_len, uint32_t parse_flags, int x5u_flags);
1745
1763int r_jws_verify_signature(jws_t * jws, jwk_t * jwk_pubkey, int x5u_flags);
1764
1778char * r_jws_serialize(jws_t * jws, jwk_t * jwk_privkey, int x5u_flags);
1779
1794char * r_jws_serialize_unsecure(jws_t * jws, jwk_t * jwk_privkey, int x5u_flags);
1795
1818json_t * r_jws_serialize_json_t(jws_t * jws, jwks_t * jwks_privkey, int x5u_flags, int mode);
1819
1842char * r_jws_serialize_json_str(jws_t * jws, jwks_t * jwks_privkey, int x5u_flags, int mode);
1843
1859int r_jwe_set_properties(jwe_t * jwe, ...);
1860
1866jwe_t * r_jwe_copy(jwe_t * jwe);
1867
1875int r_jwe_set_payload(jwe_t * jwe, const unsigned char * payload, size_t payload_len);
1876
1883const unsigned char * r_jwe_get_payload(jwe_t * jwe, size_t * payload_len);
1884
1891int r_jwe_set_alg(jwe_t * jwe, jwa_alg alg);
1892
1899
1906int r_jwe_set_enc(jwe_t * jwe, jwa_enc enc);
1907
1914
1921const char * r_jwe_get_kid(jwe_t * jwe);
1922
1930int r_jwe_set_header_str_value(jwe_t * jwe, const char * key, const char * str_value);
1931
1939int r_jwe_set_header_int_value(jwe_t * jwe, const char * key, rhn_int_t i_value);
1940
1948int r_jwe_set_header_json_t_value(jwe_t * jwe, const char * key, json_t * j_value);
1949
1956int r_jwe_set_full_header_json_t(jwe_t * jwe, json_t * j_header);
1957
1964int r_jwe_set_full_header_json_str(jwe_t * jwe, const char * str_header);
1965
1973int r_jwe_set_full_unprotected_header_json_t(jwe_t * jwe, json_t * j_unprotected_header);
1974
1982int r_jwe_set_full_unprotected_header_json_str(jwe_t * jwe, const char * str_unprotected_header);
1983
1990
1997
2004const char * r_jwe_get_header_str_value(jwe_t * jwe, const char * key);
2005
2012rhn_int_t r_jwe_get_header_int_value(jwe_t * jwe, const char * key);
2013
2020json_t * r_jwe_get_header_json_t_value(jwe_t * jwe, const char * key);
2021
2027json_t * r_jwe_get_full_header_json_t(jwe_t * jwe);
2028
2034char * r_jwe_get_full_header_str(jwe_t * jwe);
2035
2043int r_jwe_add_keys(jwe_t * jwe, jwk_t * jwk_privkey, jwk_t * jwk_pubkey);
2044
2052int r_jwe_add_jwks(jwe_t * jwe, jwks_t * jwks_privkey, jwks_t * jwks_pubkey);
2053
2062int r_jwe_add_keys_json_str(jwe_t * jwe, const char * privkey, const char * pubkey);
2063
2072int r_jwe_add_keys_json_t(jwe_t * jwe, json_t * privkey, json_t * pubkey);
2073
2085int r_jwe_add_keys_pem_der(jwe_t * jwe, int format, const unsigned char * privkey, size_t privkey_len, const unsigned char * pubkey, size_t pubkey_len);
2086
2095int r_jwe_add_keys_gnutls(jwe_t * jwe, gnutls_privkey_t privkey, gnutls_pubkey_t pubkey);
2096
2104int r_jwe_add_key_symmetric(jwe_t * jwe, const unsigned char * key, size_t key_len);
2105
2112
2119
2127int r_jwe_set_cypher_key(jwe_t * jwe, const unsigned char * key, size_t key_len);
2128
2135const unsigned char * r_jwe_get_cypher_key(jwe_t * jwe, size_t * key_len);
2136
2143
2151int r_jwe_set_iv(jwe_t * jwe, const unsigned char * iv, size_t iv_len);
2152
2159const unsigned char * r_jwe_get_iv(jwe_t * jwe, size_t * iv_len);
2160
2166int r_jwe_generate_iv(jwe_t * jwe);
2167
2175int r_jwe_set_aad(jwe_t * jwe, const unsigned char * aad, size_t aad_len);
2176
2183const unsigned char * r_jwe_get_aad(jwe_t * jwe, size_t * aad_len);
2184
2190int r_jwe_encrypt_payload(jwe_t * jwe);
2191
2197int r_jwe_decrypt_payload(jwe_t * jwe);
2198
2211int r_jwe_encrypt_key(jwe_t * jwe, jwk_t * jwk_pubkey, int x5u_flags);
2212
2225int r_jwe_decrypt_key(jwe_t * jwe, jwk_t * jwk_privkey, int x5u_flags);
2226
2239int r_jwe_parse(jwe_t * jwe, const char * jwe_str, int x5u_flags);
2240
2254int r_jwe_parsen(jwe_t * jwe, const char * jwe_str, size_t jwe_str_len, int x5u_flags);
2255
2278int r_jwe_advanced_parse(jwe_t * jwe, const char * jwe_str, uint32_t parse_flags, int x5u_flags);
2279
2303int r_jwe_advanced_parsen(jwe_t * jwe, const char * jwe_str, size_t jwe_str_len, uint32_t parse_flags, int x5u_flags);
2304
2317int r_jwe_compact_parse(jwe_t * jwe, const char * jwe_str, int x5u_flags);
2318
2332int r_jwe_compact_parsen(jwe_t * jwe, const char * jwe_str, size_t jwe_str_len, int x5u_flags);
2333
2356int r_jwe_advanced_compact_parse(jwe_t * jwe, const char * jwe_str, uint32_t parse_flags, int x5u_flags);
2357
2381int r_jwe_advanced_compact_parsen(jwe_t * jwe, const char * jwe_str, size_t jwe_str_len, uint32_t parse_flags, int x5u_flags);
2382
2395int r_jwe_parse_json_str(jwe_t * jwe, const char * jwe_json_str, int x5u_flags);
2396
2410int r_jwe_parsen_json_str(jwe_t * jwe, const char * jwe_json_str, size_t jwe_json_str_len, int x5u_flags);
2411
2424int r_jwe_parse_json_t(jwe_t * jwe, json_t * jwe_json, int x5u_flags);
2425
2448int r_jwe_advanced_parse_json_str(jwe_t * jwe, const char * jwe_json_str, uint32_t parse_flags, int x5u_flags);
2449
2473int r_jwe_advanced_parsen_json_str(jwe_t * jwe, const char * jwe_json_str, size_t jwe_json_str_len, uint32_t parse_flags, int x5u_flags);
2474
2497int r_jwe_advanced_parse_json_t(jwe_t * jwe, json_t * jwe_json, uint32_t parse_flags, int x5u_flags);
2498
2520jwe_t * r_jwe_quick_parse(const char * jwe_str, uint32_t parse_flags, int x5u_flags);
2521
2544jwe_t * r_jwe_quick_parsen(const char * jwe_str, size_t jwe_str_len, uint32_t parse_flags, int x5u_flags);
2545
2559int r_jwe_decrypt(jwe_t * jwe, jwk_t * jwk_privkey, int x5u_flags);
2560
2574char * r_jwe_serialize(jwe_t * jwe, jwk_t * jwk_pubkey, int x5u_flags);
2575
2598char * r_jwe_serialize_json_str(jwe_t * jwe, jwks_t * jwks_pubkey, int x5u_flags, int mode);
2599
2622json_t * r_jwe_serialize_json_t(jwe_t * jwe, jwks_t * jwks_pubkey, int x5u_flags, int mode);
2623
2639int r_jwt_set_properties(jwt_t * jwt, ...);
2640
2646jwt_t * r_jwt_copy(jwt_t * jwt);
2647
2655int r_jwt_set_header_str_value(jwt_t * jwt, const char * key, const char * str_value);
2656
2664int r_jwt_set_header_int_value(jwt_t * jwt, const char * key, rhn_int_t i_value);
2665
2673int r_jwt_set_header_json_t_value(jwt_t * jwt, const char * key, json_t * j_value);
2674
2681int r_jwt_set_full_header_json_t(jwt_t * jwt, json_t * j_header);
2682
2689int r_jwt_set_full_header_json_str(jwt_t * jwt, const char * str_header);
2690
2697const char * r_jwt_get_header_str_value(jwt_t * jwt, const char * key);
2698
2705rhn_int_t r_jwt_get_header_int_value(jwt_t * jwt, const char * key);
2706
2713json_t * r_jwt_get_header_json_t_value(jwt_t * jwt, const char * key);
2714
2720json_t * r_jwt_get_full_header_json_t(jwt_t * jwt);
2721
2727char * r_jwt_get_full_header_str(jwt_t * jwt);
2728
2736int r_jwt_set_claim_str_value(jwt_t * jwt, const char * key, const char * str_value);
2737
2745int r_jwt_set_claim_int_value(jwt_t * jwt, const char * key, rhn_int_t i_value);
2746
2754int r_jwt_set_claim_json_t_value(jwt_t * jwt, const char * key, json_t * j_value);
2755
2762const char * r_jwt_get_claim_str_value(jwt_t * jwt, const char * key);
2763
2770rhn_int_t r_jwt_get_claim_int_value(jwt_t * jwt, const char * key);
2771
2778json_t * r_jwt_get_claim_json_t_value(jwt_t * jwt, const char * key);
2779
2785json_t * r_jwt_get_full_claims_json_t(jwt_t * jwt);
2786
2792char * r_jwt_get_full_claims_str(jwt_t * jwt);
2793
2801int r_jwt_set_full_claims_json_t(jwt_t * jwt, json_t * j_claim);
2802
2810int r_jwt_set_full_claims_json_str(jwt_t * jwt, const char * str_claims);
2811
2819int r_jwt_append_claims_json_t(jwt_t * jwt, json_t * j_claim);
2820
2828int r_jwt_add_sign_keys(jwt_t * jwt, jwk_t * privkey, jwk_t * pubkey);
2829
2837int r_jwt_add_sign_jwks(jwt_t * jwt, jwks_t * jwks_privkey, jwks_t * jwks_pubkey);
2838
2847int r_jwt_add_sign_keys_json_str(jwt_t * jwt, const char * privkey, const char * pubkey);
2848
2857int r_jwt_add_sign_keys_json_t(jwt_t * jwt, json_t * privkey, json_t * pubkey);
2858
2870int r_jwt_add_sign_keys_pem_der(jwt_t * jwt, int format, const unsigned char * privkey, size_t privkey_len, const unsigned char * pubkey, size_t pubkey_len);
2871
2880int r_jwt_add_sign_keys_gnutls(jwt_t * jwt, gnutls_privkey_t privkey, gnutls_pubkey_t pubkey);
2881
2889int r_jwt_add_sign_key_symmetric(jwt_t * jwt, const unsigned char * key, size_t key_len);
2890
2897
2904
2912int r_jwt_add_enc_keys(jwt_t * jwt, jwk_t * privkey, jwk_t * pubkey);
2913
2921int r_jwt_add_enc_jwks(jwt_t * jwt, jwks_t * jwks_privkey, jwks_t * jwks_pubkey);
2922
2931int r_jwt_add_enc_keys_json_str(jwt_t * jwt, const char * privkey, const char * pubkey);
2932
2941int r_jwt_add_enc_keys_json_t(jwt_t * jwt, json_t * privkey, json_t * pubkey);
2942
2954int r_jwt_add_enc_keys_pem_der(jwt_t * jwt, int format, const unsigned char * privkey, size_t privkey_len, const unsigned char * pubkey, size_t pubkey_len);
2955
2964int r_jwt_add_enc_keys_gnutls(jwt_t * jwt, gnutls_privkey_t privkey, gnutls_pubkey_t pubkey);
2965
2973int r_jwt_add_enc_key_symmetric(jwt_t * jwt, const unsigned char * key, size_t key_len);
2974
2981
2988
2995int r_jwt_set_sign_alg(jwt_t * jwt, jwa_alg alg);
2996
3003
3010int r_jwt_set_enc_alg(jwt_t * jwt, jwa_alg alg);
3011
3018
3025int r_jwt_set_enc(jwt_t * jwt, jwa_enc enc);
3026
3033
3040const char * r_jwt_get_enc_kid(jwt_t * jwt);
3041
3048const char * r_jwt_get_sig_kid(jwt_t * jwt);
3049
3057int r_jwt_set_enc_cypher_key(jwt_t * jwt, const unsigned char * key, size_t key_len);
3058
3065const unsigned char * r_jwt_get_enc_cypher_key(jwt_t * jwt, size_t * key_len);
3066
3073
3081int r_jwt_set_enc_iv(jwt_t * jwt, const unsigned char * iv, size_t iv_len);
3082
3089const unsigned char * r_jwt_get_enc_iv(jwt_t * jwt, size_t * iv_len);
3090
3097
3110char * r_jwt_serialize_signed(jwt_t * jwt, jwk_t * privkey, int x5u_flags);
3111
3125char * r_jwt_serialize_signed_unsecure(jwt_t * jwt, jwk_t * privkey, int x5u_flags);
3126
3139char * r_jwt_serialize_encrypted(jwt_t * jwt, jwk_t * pubkey, int x5u_flags);
3140
3165char * r_jwt_serialize_nested(jwt_t * jwt, unsigned int type, jwk_t * sign_key, int sign_key_x5u_flags, jwk_t * encrypt_key, int encrypt_key_x5u_flags);
3166
3182int r_jwt_parse(jwt_t * jwt, const char * token, int x5u_flags);
3183
3200int r_jwt_parsen(jwt_t * jwt, const char * token, size_t token_len, int x5u_flags);
3201
3218int r_jwt_parse_unsecure(jwt_t * jwt, const char * token, int x5u_flags);
3219
3237int r_jwt_parsen_unsecure(jwt_t * jwt, const char * token, size_t token_len, int x5u_flags);
3238
3264int r_jwt_advanced_parse(jwt_t * jwt, const char * token, uint32_t parse_flags, int x5u_flags);
3265
3292int r_jwt_advanced_parsen(jwt_t * jwt, const char * token, size_t token_len, uint32_t parse_flags, int x5u_flags);
3293
3318jwt_t * r_jwt_quick_parse(const char * token, uint32_t parse_flags, int x5u_flags);
3319
3345jwt_t * r_jwt_quick_parsen(const char * token, size_t token_len, uint32_t parse_flags, int x5u_flags);
3346
3357int r_jwt_get_type(jwt_t * jwt);
3358
3368int r_jwt_token_type(const char * token);
3369
3380int r_jwt_token_typen(const char * token, size_t token_len);
3381
3397int r_jwt_verify_signature(jwt_t * jwt, jwk_t * pubkey, int x5u_flags);
3398
3412int r_jwt_decrypt(jwt_t * jwt, jwk_t * privkey, int x5u_flags);
3413
3436int r_jwt_decrypt_verify_signature_nested(jwt_t * jwt, jwk_t * verify_key, int verify_key_x5u_flags, jwk_t * decrypt_key, int decrypt_key_x5u_flags);
3437
3452int r_jwt_decrypt_nested(jwt_t * jwt, jwk_t * decrypt_key, int decrypt_key_x5u_flags);
3453
3467int r_jwt_verify_signature_nested(jwt_t * jwt, jwk_t * verify_key, int verify_key_x5u_flags);
3468
3495int r_jwt_validate_claims(jwt_t * jwt, ...);
3496
3512int r_jwt_set_claims(jwt_t * jwt, ...);
3513
3518#ifndef DOXYGEN_SHOULD_SKIP_THIS
3519
3523int _r_json_set_str_value(json_t * j_json, const char * key, const char * str_value);
3524
3525int _r_json_set_int_value(json_t * j_json, const char * key, rhn_int_t i_value);
3526
3527int _r_json_set_json_t_value(json_t * j_json, const char * key, json_t * j_value);
3528
3529const char * _r_json_get_str_value(json_t * j_json, const char * key);
3530
3531rhn_int_t _r_json_get_int_value(json_t * j_json, const char * key);
3532
3533json_t * _r_json_get_json_t_value(json_t * j_json, const char * key);
3534
3535json_t * _r_json_get_full_json_t(json_t * j_json);
3536
3537size_t _r_get_key_size(jwa_enc enc);
3538
3539gnutls_cipher_algorithm_t _r_get_alg_from_enc(jwa_enc enc);
3540
3541int _r_deflate_payload(const unsigned char * uncompressed, size_t uncompressed_len, unsigned char ** compressed, size_t * compressed_len);
3542
3543int _r_inflate_payload(const unsigned char * compressed, size_t compressed_len, unsigned char ** uncompressed, size_t * uncompressed_len);
3544
3545#endif
3546
3547#ifdef __cplusplus
3548}
3549#endif
3550
3551#endif // __RHONABWY_H_
void r_jwe_free(jwe_t *jwe)
Definition: jwe.c:2745
json_t * r_library_info_json_t(void)
Definition: misc.c:659
int r_jws_init(jws_t **jws)
Definition: jws.c:848
jwa_enc r_str_to_jwa_enc(const char *enc)
Definition: misc.c:615
void r_jws_free(jws_t *jws)
Definition: jws.c:891
void r_jwk_free(jwk_t *jwk)
Definition: jwk.c:57
void r_jwks_free(jwks_t *jwks)
Definition: jwks.c:41
char * r_library_info_json_str(void)
Definition: misc.c:718
void r_jwt_free(jwt_t *jwt)
Definition: jwt.c:95
int r_jwks_init(jwks_t **jwks)
Definition: jwks.c:30
const char * r_jwa_alg_to_str(jwa_alg alg)
Definition: misc.c:511
const char * r_jwa_enc_to_str(jwa_enc enc)
Definition: misc.c:633
jwa_alg r_str_to_jwa_alg(const char *alg)
Definition: misc.c:439
int r_jwe_init(jwe_t **jwe)
Definition: jwe.c:2691
void r_free(void *data)
Definition: misc.c:728
void r_global_close(void)
Definition: misc.c:59
int r_global_init(void)
Definition: misc.c:37
int r_jwt_init(jwt_t **jwt)
Definition: jwt.c:34
int r_jwk_init(jwk_t **jwk)
Definition: jwk.c:46
gnutls_pubkey_t r_jwk_export_to_gnutls_pubkey(jwk_t *jwk, int x5u_flags)
Definition: jwk.c:2085
gnutls_privkey_t r_jwk_export_to_gnutls_privkey(jwk_t *jwk)
Definition: jwk.c:1788
gnutls_x509_crt_t r_jwk_export_to_gnutls_crt(jwk_t *jwk, int x5u_flags)
Definition: jwk.c:2356
int r_jwk_match_json_str(jwk_t *jwk, const char *str_match)
Definition: jwk.c:2917
json_t * r_jwk_export_to_json_t(jwk_t *jwk)
Definition: jwk.c:1780
int r_jwk_export_to_symmetric_key(jwk_t *jwk, unsigned char *key, size_t *key_len)
Definition: jwk.c:2467
int r_jwk_export_to_pem_der(jwk_t *jwk, int format, unsigned char *output, size_t *output_len, int x5u_flags)
Definition: jwk.c:2411
int r_jwk_match_json_t(jwk_t *jwk, json_t *j_match)
Definition: jwk.c:2896
int r_jwk_validate_x5c_chain(jwk_t *jwk, int x5u_flags)
Definition: jwk.c:2759
char * r_jwk_thumbprint(jwk_t *jwk, int hash, int x5u_flags)
Definition: jwk.c:2665
char * r_jwk_export_to_json_str(jwk_t *jwk, int pretty)
Definition: jwk.c:1772
int r_jwk_import_from_password(jwk_t *jwk, const char *password)
Definition: jwk.c:1678
int r_jwk_import_from_json_str(jwk_t *jwk, const char *input)
Definition: jwk.c:885
int r_jwk_import_from_pem_der(jwk_t *jwk, int type, int format, const unsigned char *input, size_t input_len)
Definition: jwk.c:918
int r_jwk_import_from_json_t(jwk_t *jwk, json_t *j_input)
Definition: jwk.c:902
int r_jwk_import_from_gnutls_x509_crt(jwk_t *jwk, gnutls_x509_crt_t crt)
Definition: jwk.c:1573
int r_jwk_import_from_symmetric_key(jwk_t *jwk, const unsigned char *key, size_t key_len)
Definition: jwk.c:1653
int r_jwk_import_from_x5c(jwk_t *jwk, const char *x5c)
Definition: jwk.c:1631
int r_jwk_import_from_gnutls_pubkey(jwk_t *jwk, gnutls_pubkey_t pub)
Definition: jwk.c:1360
jwk_t * r_jwk_copy(jwk_t *jwk)
Definition: jwk.c:1760
int r_jwk_equal(jwk_t *jwk1, jwk_t *jwk2)
Definition: jwk.c:1768
jwk_t * r_jwk_quick_import(rhn_import type,...)
Definition: jwk.c:1682
int r_jwk_extract_pubkey(jwk_t *jwk_privkey, jwk_t *jwk_pubkey, int x5u_flags)
Definition: jwk.c:834
int r_jwk_import_from_x5u(jwk_t *jwk, int x5u_flags, const char *x5u)
Definition: jwk.c:1609
int r_jwk_import_from_gnutls_privkey(jwk_t *jwk, gnutls_privkey_t key)
Definition: jwk.c:1047
int r_jwe_parsen_json_str(jwe_t *jwe, const char *jwe_json_str, size_t jwe_json_str_len, int x5u_flags)
Definition: jwe.c:3963
int r_jwe_set_iv(jwe_t *jwe, const unsigned char *iv, size_t iv_len)
Definition: jwe.c:2899
int r_jwe_set_properties(jwe_t *jwe,...)
Definition: jwe.c:4523
int r_jwe_set_header_json_t_value(jwe_t *jwe, const char *key, json_t *j_value)
Definition: jwe.c:3100
int r_jwe_encrypt_payload(jwe_t *jwe)
Definition: jwe.c:3422
jwe_t * r_jwe_quick_parsen(const char *jwe_str, size_t jwe_str_len, uint32_t parse_flags, int x5u_flags)
Definition: jwe.c:4128
char * r_jwe_serialize_json_str(jwe_t *jwe, jwks_t *jwks_pubkey, int x5u_flags, int mode)
Definition: jwe.c:4313
int r_jwe_add_keys_pem_der(jwe_t *jwe, int format, const unsigned char *privkey, size_t privkey_len, const unsigned char *pubkey, size_t pubkey_len)
Definition: jwe.c:3303
const unsigned char * r_jwe_get_aad(jwe_t *jwe, size_t *aad_len)
Definition: jwe.c:2981
int r_jwe_set_payload(jwe_t *jwe, const unsigned char *payload, size_t payload_len)
Definition: jwe.c:2801
int r_jwe_set_enc(jwe_t *jwe, jwa_enc enc)
Definition: jwe.c:3049
int r_jwe_decrypt_payload(jwe_t *jwe)
Definition: jwe.c:3586
const unsigned char * r_jwe_get_cypher_key(jwe_t *jwe, size_t *key_len)
Definition: jwe.c:2861
char * r_jwe_get_full_header_str(jwe_t *jwe)
Definition: jwe.c:3143
jwa_enc r_jwe_get_enc(jwe_t *jwe)
Definition: jwe.c:3060
int r_jwe_parse(jwe_t *jwe, const char *jwe_str, int x5u_flags)
Definition: jwe.c:3819
int r_jwe_set_alg(jwe_t *jwe, jwa_alg alg)
Definition: jwe.c:3030
int r_jwe_advanced_parse_json_t(jwe_t *jwe, json_t *jwe_json, uint32_t parse_flags, int x5u_flags)
Definition: jwe.c:3993
jwe_t * r_jwe_quick_parse(const char *jwe_str, uint32_t parse_flags, int x5u_flags)
Definition: jwe.c:4124
const unsigned char * r_jwe_get_iv(jwe_t *jwe, size_t *iv_len)
Definition: jwe.c:2934
int r_jwe_set_full_unprotected_header_json_t(jwe_t *jwe, json_t *j_unprotected_header)
Definition: jwe.c:4497
int r_jwe_advanced_parse_json_str(jwe_t *jwe, const char *jwe_json_str, uint32_t parse_flags, int x5u_flags)
Definition: jwe.c:3978
int r_jwe_add_keys_gnutls(jwe_t *jwe, gnutls_privkey_t privkey, gnutls_pubkey_t pubkey)
Definition: jwe.c:3342
int r_jwe_generate_iv(jwe_t *jwe)
Definition: jwe.c:2991
int r_jwe_set_full_unprotected_header_json_str(jwe_t *jwe, const char *str_unprotected_header)
Definition: jwe.c:4513
int r_jwe_advanced_parse(jwe_t *jwe, const char *jwe_str, uint32_t parse_flags, int x5u_flags)
Definition: jwe.c:3846
int r_jwe_generate_cypher_key(jwe_t *jwe)
Definition: jwe.c:2871
json_t * r_jwe_get_header_json_t_value(jwe_t *jwe, const char *key)
Definition: jwe.c:3129
int r_jwe_add_keys(jwe_t *jwe, jwk_t *jwk_privkey, jwk_t *jwk_pubkey)
Definition: jwe.c:3166
int r_jwe_parse_json_str(jwe_t *jwe, const char *jwe_json_str, int x5u_flags)
Definition: jwe.c:3959
char * r_jwe_get_full_unprotected_header_str(jwe_t *jwe)
Definition: jwe.c:3158
int r_jwe_set_cypher_key(jwe_t *jwe, const unsigned char *key, size_t key_len)
Definition: jwe.c:2836
int r_jwe_add_keys_json_str(jwe_t *jwe, const char *privkey, const char *pubkey)
Definition: jwe.c:3225
int r_jwe_compact_parse(jwe_t *jwe, const char *jwe_str, int x5u_flags)
Definition: jwe.c:3877
int r_jwe_advanced_parsen(jwe_t *jwe, const char *jwe_str, size_t jwe_str_len, uint32_t parse_flags, int x5u_flags)
Definition: jwe.c:3850
jwks_t * r_jwe_get_jwks_pubkey(jwe_t *jwe)
Definition: jwe.c:3414
json_t * r_jwe_get_full_unprotected_header_json_t(jwe_t *jwe)
Definition: jwe.c:3151
int r_jwe_add_keys_json_t(jwe_t *jwe, json_t *privkey, json_t *pubkey)
Definition: jwe.c:3264
int r_jwe_advanced_compact_parsen(jwe_t *jwe, const char *jwe_str, size_t jwe_str_len, uint32_t parse_flags, int x5u_flags)
Definition: jwe.c:3885
int r_jwe_set_full_header_json_t(jwe_t *jwe, json_t *j_header)
Definition: jwe.c:4451
int r_jwe_parsen(jwe_t *jwe, const char *jwe_str, size_t jwe_str_len, int x5u_flags)
Definition: jwe.c:3823
json_t * r_jwe_get_full_header_json_t(jwe_t *jwe)
Definition: jwe.c:3136
int r_jwe_add_key_symmetric(jwe_t *jwe, const unsigned char *key, size_t key_len)
Definition: jwe.c:3381
int r_jwe_decrypt(jwe_t *jwe, jwk_t *jwk_privkey, int x5u_flags)
Definition: jwe.c:4145
int r_jwe_decrypt_key(jwe_t *jwe, jwk_t *jwk_privkey, int x5u_flags)
Definition: jwe.c:3793
int r_jwe_compact_parsen(jwe_t *jwe, const char *jwe_str, size_t jwe_str_len, int x5u_flags)
Definition: jwe.c:3873
const unsigned char * r_jwe_get_payload(jwe_t *jwe, size_t *payload_len)
Definition: jwe.c:2826
json_t * r_jwe_serialize_json_t(jwe_t *jwe, jwks_t *jwks_pubkey, int x5u_flags, int mode)
Definition: jwe.c:4320
int r_jwe_set_aad(jwe_t *jwe, const unsigned char *aad, size_t aad_len)
Definition: jwe.c:2944
const char * r_jwe_get_kid(jwe_t *jwe)
Definition: jwe.c:3068
rhn_int_t r_jwe_get_header_int_value(jwe_t *jwe, const char *key)
Definition: jwe.c:3122
int r_jwe_parse_json_t(jwe_t *jwe, json_t *jwe_json, int x5u_flags)
Definition: jwe.c:3974
jwa_alg r_jwe_get_alg(jwe_t *jwe)
Definition: jwe.c:3041
int r_jwe_advanced_parsen_json_str(jwe_t *jwe, const char *jwe_json_str, size_t jwe_json_str_len, uint32_t parse_flags, int x5u_flags)
Definition: jwe.c:3982
int r_jwe_encrypt_key(jwe_t *jwe, jwk_t *jwk_pubkey, int x5u_flags)
Definition: jwe.c:3745
int r_jwe_set_full_header_json_str(jwe_t *jwe, const char *str_header)
Definition: jwe.c:4487
char * r_jwe_serialize(jwe_t *jwe, jwk_t *jwk_pubkey, int x5u_flags)
Definition: jwe.c:4255
jwe_t * r_jwe_copy(jwe_t *jwe)
Definition: jwe.c:2766
jwks_t * r_jwe_get_jwks_privkey(jwe_t *jwe)
Definition: jwe.c:3406
int r_jwe_set_header_str_value(jwe_t *jwe, const char *key, const char *str_value)
Definition: jwe.c:3072
int r_jwe_advanced_compact_parse(jwe_t *jwe, const char *jwe_str, uint32_t parse_flags, int x5u_flags)
Definition: jwe.c:3881
int r_jwe_set_header_int_value(jwe_t *jwe, const char *key, rhn_int_t i_value)
Definition: jwe.c:3086
int r_jwe_add_jwks(jwe_t *jwe, jwks_t *jwks_privkey, jwks_t *jwks_pubkey)
Definition: jwe.c:3192
const char * r_jwe_get_header_str_value(jwe_t *jwe, const char *key)
Definition: jwe.c:3115
const char * r_jwk_get_property_str(jwk_t *jwk, const char *key)
Definition: jwk.c:2504
int r_jwk_set_property_array(jwk_t *jwk, const char *key, size_t index, const char *value)
Definition: jwk.c:2555
int r_jwk_delete_property_str(jwk_t *jwk, const char *key)
Definition: jwk.c:2597
int r_jwk_append_property_array(jwk_t *jwk, const char *key, const char *value)
Definition: jwk.c:2579
const char * r_jwk_get_property_array(jwk_t *jwk, const char *key, size_t index)
Definition: jwk.c:2516
int r_jwk_set_property_str(jwk_t *jwk, const char *key, const char *value)
Definition: jwk.c:2542
int r_jwk_append_x5c(jwk_t *jwk, int format, const unsigned char *input, size_t input_len)
Definition: jwk.c:2623
int r_jwk_get_property_array_size(jwk_t *jwk, const char *key)
Definition: jwk.c:2529
int r_jwk_delete_property_array_at(jwk_t *jwk, const char *key, size_t index)
Definition: jwk.c:2610
int r_jwk_generate_key_pair(jwk_t *jwk_privkey, jwk_t *jwk_pubkey, int type, unsigned int bits, const char *kid)
Definition: jwk.c:487
int r_jwk_is_valid_x5u(jwk_t *jwk, int x5u_flags)
Definition: jwk.c:403
int r_jwk_key_type(jwk_t *jwk, unsigned int *bits, int x5u_flags)
Definition: jwk.c:640
int r_jwk_is_valid(jwk_t *jwk)
Definition: jwk.c:63
size_t r_jwks_size(jwks_t *jwks)
Definition: jwks.c:68
jwks_t * r_jwks_search_json_t(jwks_t *jwks, json_t *j_match)
Definition: jwks.c:471
json_t * r_jwks_export_to_json_t(jwks_t *jwks)
Definition: jwks.c:169
jwk_t * r_jwks_get_at(jwks_t *jwks, size_t index)
Definition: jwks.c:76
int r_jwks_import_from_uri(jwks_t *jwks, const char *uri, int x5u_flags)
Definition: jwks.c:310
char * r_jwks_export_to_json_str(jwks_t *jwks, int pretty)
Definition: jwks.c:161
jwks_t * r_jwks_search_json_str(jwks_t *jwks, const char *str_match)
Definition: jwks.c:494
int r_jwks_equal(jwks_t *jwks1, jwks_t *jwks2)
Definition: jwks.c:157
int r_jwks_import_from_json_t(jwks_t *jwks, json_t *j_input)
Definition: jwks.c:271
int r_jwks_remove_at(jwks_t *jwks, size_t index)
Definition: jwks.c:131
jwk_t * r_jwks_get_by_kid(jwks_t *jwks, const char *kid)
Definition: jwks.c:84
int r_jwks_is_valid(jwks_t *jwks)
Definition: jwks.c:47
int r_jwks_set_at(jwks_t *jwks, size_t index, jwk_t *jwk)
Definition: jwks.c:118
int r_jwks_append_jwk(jwks_t *jwks, jwk_t *jwk)
Definition: jwks.c:105
jwks_t * r_jwks_copy(jwks_t *jwks)
Definition: jwks.c:97
jwks_t * r_jwks_quick_import(rhn_import,...)
Definition: jwks.c:336
int r_jwks_import_from_json_str(jwks_t *jwks, const char *input)
Definition: jwks.c:248
gnutls_pubkey_t * r_jwks_export_to_gnutls_pubkey(jwks_t *jwks, size_t *len, int x5u_flags)
Definition: jwks.c:199
gnutls_privkey_t * r_jwks_export_to_gnutls_privkey(jwks_t *jwks, size_t *len)
Definition: jwks.c:177
int r_jwks_empty(jwks_t *jwks)
Definition: jwks.c:144
int r_jwks_export_to_pem_der(jwks_t *jwks, int format, unsigned char *output, size_t *output_len, int x5u_flags)
Definition: jwks.c:221
int r_jws_set_full_header_json_t(jws_t *jws, json_t *j_value)
Definition: jws.c:2009
jwks_t * r_jws_get_jwks_privkey(jws_t *jws)
Definition: jws.c:1368
int r_jws_compact_parsen_unsecure(jws_t *jws, const char *jws_str, size_t jws_str_len, int x5u_flags)
Definition: jws.c:1444
json_t * r_jws_get_full_header_json_t(jws_t *jws)
Definition: jws.c:1113
int r_jws_advanced_parse_json_str(jws_t *jws, const char *jws_json_str, uint32_t parse_flags, int x5u_flags)
Definition: jws.c:1565
int r_jws_advanced_parse_json_t(jws_t *jws, json_t *jws_json, uint32_t parse_flags, int x5u_flags)
Definition: jws.c:1580
int r_jws_verify_signature(jws_t *jws, jwk_t *jwk_pubkey, int x5u_flags)
Definition: jws.c:1781
int r_jws_set_header_str_value(jws_t *jws, const char *key, const char *str_value)
Definition: jws.c:1049
jws_t * r_jws_quick_parse(const char *jws_str, uint32_t parse_flags, int x5u_flags)
Definition: jws.c:1760
char * r_jws_serialize_json_str(jws_t *jws, jwks_t *jwks_privkey, int x5u_flags, int mode)
Definition: jws.c:1926
int r_jws_add_keys(jws_t *jws, jwk_t *jwk_privkey, jwk_t *jwk_pubkey)
Definition: jws.c:1128
int r_jws_add_key_symmetric(jws_t *jws, const unsigned char *key, size_t key_len)
Definition: jws.c:1343
rhn_int_t r_jws_get_header_int_value(jws_t *jws, const char *key)
Definition: jws.c:1099
int r_jws_advanced_compact_parse(jws_t *jws, const char *jws_str, uint32_t parse_flags, int x5u_flags)
Definition: jws.c:1452
const char * r_jws_get_kid(jws_t *jws)
Definition: jws.c:1039
int r_jws_set_properties(jws_t *jws,...)
Definition: jws.c:2046
json_t * r_jws_serialize_json_t(jws_t *jws, jwks_t *jwks_privkey, int x5u_flags, int mode)
Definition: jws.c:1933
jwks_t * r_jws_get_jwks_pubkey(jws_t *jws)
Definition: jws.c:1376
int r_jws_advanced_parsen(jws_t *jws, const char *jws_str, size_t jws_str_len, uint32_t parse_flags, int x5u_flags)
Definition: jws.c:1404
int r_jws_parsen_unsecure(jws_t *jws, const char *jws_str, size_t jws_str_len, int x5u_flags)
Definition: jws.c:1396
int r_jws_advanced_parse(jws_t *jws, const char *jws_str, uint32_t parse_flags, int x5u_flags)
Definition: jws.c:1400
int r_jws_parse_unsecure(jws_t *jws, const char *jws_str, int x5u_flags)
Definition: jws.c:1392
int r_jws_set_header_json_t_value(jws_t *jws, const char *key, json_t *j_value)
Definition: jws.c:1077
char * r_jws_serialize(jws_t *jws, jwk_t *jwk_privkey, int x5u_flags)
Definition: jws.c:1873
int r_jws_parsen(jws_t *jws, const char *jws_str, size_t jws_str_len, int x5u_flags)
Definition: jws.c:1388
int r_jws_compact_parsen(jws_t *jws, const char *jws_str, size_t jws_str_len, int x5u_flags)
Definition: jws.c:1427
jws_t * r_jws_quick_parsen(const char *jws_str, size_t jws_str_len, uint32_t parse_flags, int x5u_flags)
Definition: jws.c:1764
int r_jws_advanced_parsen_json_str(jws_t *jws, const char *jws_json_str, size_t jws_json_str_len, uint32_t parse_flags, int x5u_flags)
Definition: jws.c:1569
int r_jws_parsen_json_str(jws_t *jws, const char *jws_json_str, size_t jws_json_str_len, int x5u_flags)
Definition: jws.c:1550
int r_jws_parse_json_t(jws_t *jws, json_t *jws_json, int x5u_flags)
Definition: jws.c:1546
int r_jws_add_keys_json_str(jws_t *jws, const char *privkey, const char *pubkey)
Definition: jws.c:1187
int r_jws_add_keys_pem_der(jws_t *jws, int format, const unsigned char *privkey, size_t privkey_len, const unsigned char *pubkey, size_t pubkey_len)
Definition: jws.c:1265
int r_jws_add_keys_gnutls(jws_t *jws, gnutls_privkey_t privkey, gnutls_pubkey_t pubkey)
Definition: jws.c:1304
jws_t * r_jws_copy(jws_t *jws)
Definition: jws.c:905
char * r_jws_serialize_unsecure(jws_t *jws, jwk_t *jwk_privkey, int x5u_flags)
Definition: jws.c:1881
int r_jws_compact_parse_unsecure(jws_t *jws, const char *jws_str, int x5u_flags)
Definition: jws.c:1448
int r_jws_add_jwks(jws_t *jws, jwks_t *jwks_privkey, jwks_t *jwks_pubkey)
Definition: jws.c:1154
json_t * r_jws_get_header_json_t_value(jws_t *jws, const char *key)
Definition: jws.c:1106
int r_jws_set_payload(jws_t *jws, const unsigned char *payload, size_t payload_len)
Definition: jws.c:933
int r_jws_advanced_compact_parsen(jws_t *jws, const char *jws_str, size_t jws_str_len, uint32_t parse_flags, int x5u_flags)
Definition: jws.c:1456
jwa_alg r_jws_get_alg(jws_t *jws)
Definition: jws.c:1031
int r_jws_set_full_header_json_str(jws_t *jws, const char *str_value)
Definition: jws.c:2036
int r_jws_parse_json_str(jws_t *jws, const char *jws_json_str, int x5u_flags)
Definition: jws.c:1561
int r_jws_compact_parse(jws_t *jws, const char *jws_str, int x5u_flags)
Definition: jws.c:1440
char * r_jws_get_full_header_str(jws_t *jws)
Definition: jws.c:1120
int r_jws_parse(jws_t *jws, const char *jws_str, int x5u_flags)
Definition: jws.c:1384
int r_jws_add_keys_json_t(jws_t *jws, json_t *privkey, json_t *pubkey)
Definition: jws.c:1226
const char * r_jws_get_header_str_value(jws_t *jws, const char *key)
Definition: jws.c:1092
int r_jws_set_alg(jws_t *jws, jwa_alg alg)
Definition: jws.c:968
const unsigned char * r_jws_get_payload(jws_t *jws, size_t *payload_len)
Definition: jws.c:958
int r_jws_set_header_int_value(jws_t *jws, const char *key, rhn_int_t i_value)
Definition: jws.c:1063
int r_jwt_set_sign_alg(jwt_t *jwt, jwa_alg alg)
Definition: jwt.c:814
int r_jwt_token_typen(const char *token, size_t token_len)
Definition: jwt.c:2380
int r_jwt_add_enc_key_symmetric(jwt_t *jwt, const unsigned char *key, size_t key_len)
Definition: jwt.c:773
int r_jwt_set_claims(jwt_t *jwt,...)
Definition: jwt.c:1962
int r_jwt_advanced_parse(jwt_t *jwt, const char *token, uint32_t parse_flags, int x5u_flags)
Definition: jwt.c:1202
const char * r_jwt_get_claim_str_value(jwt_t *jwt, const char *key)
Definition: jwt.c:220
json_t * r_jwt_get_full_claims_json_t(jwt_t *jwt)
Definition: jwt.c:241
const unsigned char * r_jwt_get_enc_iv(jwt_t *jwt, size_t *iv_len)
Definition: jwt.c:952
int r_jwt_decrypt_nested(jwt_t *jwt, jwk_t *decrypt_key, int decrypt_key_x5u_flags)
Definition: jwt.c:1564
char * r_jwt_serialize_encrypted(jwt_t *jwt, jwk_t *pubkey, int x5u_flags)
Definition: jwt.c:1055
int r_jwt_set_header_json_t_value(jwt_t *jwt, const char *key, json_t *j_value)
Definition: jwt.c:152
jwks_t * r_jwt_get_sign_jwks_pubkey(jwt_t *jwt)
Definition: jwt.c:550
int r_jwt_verify_signature(jwt_t *jwt, jwk_t *pubkey, int x5u_flags)
Definition: jwt.c:1341
char * r_jwt_serialize_signed_unsecure(jwt_t *jwt, jwk_t *privkey, int x5u_flags)
Definition: jwt.c:1014
int r_jwt_add_sign_keys_json_t(jwt_t *jwt, json_t *privkey, json_t *pubkey)
Definition: jwt.c:400
char * r_jwt_get_full_claims_str(jwt_t *jwt)
Definition: jwt.c:248
int r_jwt_add_sign_keys_pem_der(jwt_t *jwt, int format, const unsigned char *privkey, size_t privkey_len, const unsigned char *pubkey, size_t pubkey_len)
Definition: jwt.c:439
json_t * r_jwt_get_full_header_json_t(jwt_t *jwt)
Definition: jwt.c:181
const char * r_jwt_get_sig_kid(jwt_t *jwt)
Definition: jwt.c:1002
jwa_alg r_jwt_get_enc_alg(jwt_t *jwt)
Definition: jwt.c:846
int r_jwt_set_enc_iv(jwt_t *jwt, const unsigned char *iv, size_t iv_len)
Definition: jwt.c:927
char * r_jwt_serialize_nested(jwt_t *jwt, unsigned int type, jwk_t *sign_key, int sign_key_x5u_flags, jwk_t *encrypt_key, int encrypt_key_x5u_flags)
Definition: jwt.c:1105
jwks_t * r_jwt_get_enc_jwks_privkey(jwt_t *jwt)
Definition: jwt.c:798
int r_jwt_parse_unsecure(jwt_t *jwt, const char *token, int x5u_flags)
Definition: jwt.c:1198
rhn_int_t r_jwt_get_claim_int_value(jwt_t *jwt, const char *key)
Definition: jwt.c:227
jwks_t * r_jwt_get_sign_jwks_privkey(jwt_t *jwt)
Definition: jwt.c:542
jwa_enc r_jwt_get_enc(jwt_t *jwt)
Definition: jwt.c:990
const char * r_jwt_get_header_str_value(jwt_t *jwt, const char *key)
Definition: jwt.c:160
jwt_t * r_jwt_copy(jwt_t *jwt)
Definition: jwt.c:111
const unsigned char * r_jwt_get_enc_cypher_key(jwt_t *jwt, size_t *key_len)
Definition: jwt.c:891
int r_jwt_set_enc_alg(jwt_t *jwt, jwa_alg alg)
Definition: jwt.c:834
int r_jwt_set_full_header_json_t(jwt_t *jwt, json_t *j_header)
Definition: jwt.c:2107
jwt_t * r_jwt_quick_parsen(const char *token, size_t token_len, uint32_t parse_flags, int x5u_flags)
Definition: jwt.c:1316
json_t * r_jwt_get_claim_json_t_value(jwt_t *jwt, const char *key)
Definition: jwt.c:234
int r_jwt_decrypt(jwt_t *jwt, jwk_t *privkey, int x5u_flags)
Definition: jwt.c:1366
int r_jwt_token_type(const char *token)
Definition: jwt.c:2376
jwt_t * r_jwt_quick_parse(const char *token, uint32_t parse_flags, int x5u_flags)
Definition: jwt.c:1312
int r_jwt_set_full_claims_json_str(jwt_t *jwt, const char *str_claims)
Definition: jwt.c:267
int r_jwt_set_claim_str_value(jwt_t *jwt, const char *key, const char *str_value)
Definition: jwt.c:196
int r_jwt_set_enc_cypher_key(jwt_t *jwt, const unsigned char *key, size_t key_len)
Definition: jwt.c:866
int r_jwt_parsen(jwt_t *jwt, const char *token, size_t token_len, int x5u_flags)
Definition: jwt.c:1190
int r_jwt_set_claim_int_value(jwt_t *jwt, const char *key, rhn_int_t i_value)
Definition: jwt.c:204
int r_jwt_add_enc_keys_pem_der(jwt_t *jwt, int format, const unsigned char *privkey, size_t privkey_len, const unsigned char *pubkey, size_t pubkey_len)
Definition: jwt.c:695
jwa_alg r_jwt_get_sign_alg(jwt_t *jwt)
Definition: jwt.c:826
int r_jwt_advanced_parsen(jwt_t *jwt, const char *token, size_t token_len, uint32_t parse_flags, int x5u_flags)
Definition: jwt.c:1206
int r_jwt_decrypt_verify_signature_nested(jwt_t *jwt, jwk_t *verify_key, int verify_key_x5u_flags, jwk_t *decrypt_key, int decrypt_key_x5u_flags)
Definition: jwt.c:1420
jwks_t * r_jwt_get_enc_jwks_pubkey(jwt_t *jwt)
Definition: jwt.c:806
int r_jwt_set_claim_json_t_value(jwt_t *jwt, const char *key, json_t *j_value)
Definition: jwt.c:212
int r_jwt_verify_signature_nested(jwt_t *jwt, jwk_t *verify_key, int verify_key_x5u_flags)
Definition: jwt.c:1661
int r_jwt_set_properties(jwt_t *jwt,...)
Definition: jwt.c:2161
rhn_int_t r_jwt_get_header_int_value(jwt_t *jwt, const char *key)
Definition: jwt.c:167
int r_jwt_add_enc_jwks(jwt_t *jwt, jwks_t *jwks_privkey, jwks_t *jwks_pubkey)
Definition: jwt.c:584
int r_jwt_add_sign_keys_gnutls(jwt_t *jwt, gnutls_privkey_t privkey, gnutls_pubkey_t pubkey)
Definition: jwt.c:478
int r_jwt_add_enc_keys_json_str(jwt_t *jwt, const char *privkey, const char *pubkey)
Definition: jwt.c:617
int r_jwt_validate_claims(jwt_t *jwt,...)
Definition: jwt.c:1693
int r_jwt_add_sign_key_symmetric(jwt_t *jwt, const unsigned char *key, size_t key_len)
Definition: jwt.c:517
int r_jwt_parsen_unsecure(jwt_t *jwt, const char *token, size_t token_len, int x5u_flags)
Definition: jwt.c:1194
char * r_jwt_get_full_header_str(jwt_t *jwt)
Definition: jwt.c:188
int r_jwt_set_header_str_value(jwt_t *jwt, const char *key, const char *str_value)
Definition: jwt.c:136
int r_jwt_parse(jwt_t *jwt, const char *token, int x5u_flags)
Definition: jwt.c:1186
int r_jwt_set_full_claims_json_t(jwt_t *jwt, json_t *j_claim)
Definition: jwt.c:256
int r_jwt_add_sign_keys(jwt_t *jwt, jwk_t *privkey, jwk_t *pubkey)
Definition: jwt.c:302
int r_jwt_append_claims_json_t(jwt_t *jwt, json_t *j_claim)
Definition: jwt.c:284
int r_jwt_add_sign_keys_json_str(jwt_t *jwt, const char *privkey, const char *pubkey)
Definition: jwt.c:361
int r_jwt_set_enc(jwt_t *jwt, jwa_enc enc)
Definition: jwt.c:854
int r_jwt_add_sign_jwks(jwt_t *jwt, jwks_t *jwks_privkey, jwks_t *jwks_pubkey)
Definition: jwt.c:328
int r_jwt_add_enc_keys(jwt_t *jwt, jwk_t *privkey, jwk_t *pubkey)
Definition: jwt.c:558
int r_jwt_add_enc_keys_json_t(jwt_t *jwt, json_t *privkey, json_t *pubkey)
Definition: jwt.c:656
int r_jwt_set_full_header_json_str(jwt_t *jwt, const char *str_header)
Definition: jwt.c:2151
const char * r_jwt_get_enc_kid(jwt_t *jwt)
Definition: jwt.c:998
int r_jwt_set_header_int_value(jwt_t *jwt, const char *key, rhn_int_t i_value)
Definition: jwt.c:144
int r_jwt_generate_iv(jwt_t *jwt)
char * r_jwt_serialize_signed(jwt_t *jwt, jwk_t *privkey, int x5u_flags)
Definition: jwt.c:1006
json_t * r_jwt_get_header_json_t_value(jwt_t *jwt, const char *key)
Definition: jwt.c:174
int r_jwt_add_enc_keys_gnutls(jwt_t *jwt, gnutls_privkey_t privkey, gnutls_pubkey_t pubkey)
Definition: jwt.c:734
int r_jwt_generate_enc_cypher_key(jwt_t *jwt)
Definition: jwt.c:901
int r_jwt_get_type(jwt_t *jwt)
Definition: jwt.c:1333
jwa_enc
Definition: rhonabwy.h:170
rhn_opt
Definition: rhonabwy.h:180
json_int_t rhn_int_t
Definition: rhonabwy.h:113
rhn_import
Definition: rhonabwy.h:229
rhn_claim_opt
Definition: rhonabwy.h:153
jwa_alg
Definition: rhonabwy.h:117
json_t jwk_t
Definition: rhonabwy.h:111
json_t jwks_t
Definition: rhonabwy.h:112
@ R_JWA_ENC_UNKNOWN
Definition: rhonabwy.h:171
@ R_JWA_ENC_A192GCM
Definition: rhonabwy.h:176
@ R_JWA_ENC_A128GCM
Definition: rhonabwy.h:175
@ R_JWA_ENC_A128CBC
Definition: rhonabwy.h:172
@ R_JWA_ENC_A256GCM
Definition: rhonabwy.h:177
@ R_JWA_ENC_A192CBC
Definition: rhonabwy.h:173
@ R_JWA_ENC_A256CBC
Definition: rhonabwy.h:174
@ RHN_OPT_VERIFY_KEY_JWKS
Public key set in JWKS format to verify the token signature, following parameter must be a jwks_t * v...
Definition: rhonabwy.h:210
@ RHN_OPT_SIG_ALG
Signature algorithm, following parameter must be a jwa_alg value.
Definition: rhonabwy.h:199
@ RHN_OPT_HEADER_JSON_T_VALUE
Header JSON value, following parameters must be const char * name, json_t * j_value.
Definition: rhonabwy.h:185
@ RHN_OPT_HEADER_INT_VALUE
Header Integer value, following parameters must be const char * name, int i_value.
Definition: rhonabwy.h:182
@ RHN_OPT_DECRYPT_KEY_JWK
Private key in JWK format to decrypt the token, following parameter must be a jwk_t * value.
Definition: rhonabwy.h:221
@ RHN_OPT_SIGN_KEY_JSON_T
Private key in JSON format to sign the token, following parameter must be a json_t * value.
Definition: rhonabwy.h:206
@ RHN_OPT_ENCRYPT_KEY_JSON_T
Public key in JSON format to encrypt the token, following parameter must be a json_t * value.
Definition: rhonabwy.h:218
@ RHN_OPT_HEADER_FULL_JSON_STR
Stringified JSON value to set the entire header, following parameter must be const char * str_value.
Definition: rhonabwy.h:187
@ RHN_OPT_DECRYPT_KEY_JWKS
Private key set in JWKS format to decrypt the token, following parameter must be a jwks_t * value.
Definition: rhonabwy.h:222
@ RHN_OPT_ENCRYPT_KEY_JSON_STR
Public key in stringified JSON format to encrypt the token, following parameter must be a const char ...
Definition: rhonabwy.h:219
@ RHN_OPT_VERIFY_KEY_JWK
Public key in JWK format to verify the token signature, following parameter must be a jwk_t * value.
Definition: rhonabwy.h:209
@ RHN_OPT_DECRYPT_KEY_JSON_STR
Private key in stringified JSON format to decrypt the token, following parameter must be a const char...
Definition: rhonabwy.h:225
@ RHN_OPT_ENCRYPT_KEY_GNUTLS
Public key in GnuTLS format to encrypt the token, following parameter must be a gnutls_pubkey_t value...
Definition: rhonabwy.h:217
@ RHN_OPT_VERIFY_KEY_GNUTLS
Public key in GnuTLS format to verify the token signature, following parameter must be a gnutls_pubke...
Definition: rhonabwy.h:211
@ RHN_OPT_SIGN_KEY_GNUTLS
Private key in GnuTLS format to sign the token, following parameter must be a gnutls_privkey_t value.
Definition: rhonabwy.h:205
@ RHN_OPT_HEADER_STR_VALUE
Header String value, following parameters must be const char * name, const char * str_value.
Definition: rhonabwy.h:184
@ RHN_OPT_ENCRYPT_KEY_PEM_DER
Public key in PEM or DER format to encrypt the token, following parameter must be R_FORMAT_PEM or R_F...
Definition: rhonabwy.h:220
@ RHN_OPT_UN_HEADER_FULL_JSON_STR
Stringified JSON value to set the entire unprotected header, following parameter must be const char *...
Definition: rhonabwy.h:189
@ RHN_OPT_AAD
Additional Authenticated Data (AAD) for data encryption, following parameters must be const unsigned ...
Definition: rhonabwy.h:202
@ RHN_OPT_HEADER_FULL_JSON_T
JSON value to set the entire header, following parameter must be json_t * j_value.
Definition: rhonabwy.h:186
@ RHN_OPT_CLAIM_INT_VALUE
Claims Integer value, following parameters must be const char * name, int i_value.
Definition: rhonabwy.h:191
@ RHN_OPT_VERIFY_KEY_JSON_STR
Public key in stringified JSON format to verify the token signature, following parameter must be a co...
Definition: rhonabwy.h:213
@ RHN_OPT_CIPHER_KEY
Cipher key to encrypt data, following parameters must be const unsigned char * value,...
Definition: rhonabwy.h:200
@ RHN_OPT_SIGN_KEY_JWK
Private key in JWK format to sign the token, following parameter must be a jwk_t * value.
Definition: rhonabwy.h:203
@ RHN_OPT_VERIFY_KEY_PEM_DER
Public key in PEM or DER format to verify the token signature, following parameter must be R_FORMAT_P...
Definition: rhonabwy.h:214
@ RHN_OPT_CLAIM_FULL_JSON_STR
Stringified JSON value to set the entire claims, following parameter must be const char * str_value.
Definition: rhonabwy.h:196
@ RHN_OPT_CLAIM_STR_VALUE
Claims String value, following parameters must be const char * name, const char * str_value.
Definition: rhonabwy.h:193
@ RHN_OPT_IV
Initial Value (IV) for data encryption, following parameters must be const unsigned char * value,...
Definition: rhonabwy.h:201
@ RHN_OPT_SIGN_KEY_PEM_DER
Private key in PEM or DER format to sign the token, following parameter must be R_FORMAT_PEM or R_FOR...
Definition: rhonabwy.h:208
@ RHN_OPT_HEADER_RHN_INT_VALUE
Header rhn_int_t value, following parameters must be const char * name, rhn_int_t i_value.
Definition: rhonabwy.h:183
@ RHN_OPT_DECRYPT_KEY_JSON_T
Private key in JSON format to decrypt the token, following parameter must be a json_t * value.
Definition: rhonabwy.h:224
@ RHN_OPT_CLAIM_JSON_T_VALUE
Claims JSON value, following parameters must be const char * name, json_t * j_value.
Definition: rhonabwy.h:194
@ RHN_OPT_DECRYPT_KEY_PEM_DER
Private key in PEM or DER format to decrypt the token, following parameter must be R_FORMAT_PEM or R_...
Definition: rhonabwy.h:226
@ RHN_OPT_SIGN_KEY_JWKS
Private key set in JWKS format to sign the token, following parameter must be a jwks_t * value.
Definition: rhonabwy.h:204
@ RHN_OPT_SIGN_KEY_JSON_STR
Private key in stringified JSON format to sign the token, following parameter must be a const char * ...
Definition: rhonabwy.h:207
@ RHN_OPT_UN_HEADER_FULL_JSON_T
JSON value to set the entire unprotected header, following parameter must be json_t * j_value.
Definition: rhonabwy.h:188
@ RHN_OPT_CLAIM_FULL_JSON_T
JSON value to set the entire claims, following parameter must be json_t * j_value.
Definition: rhonabwy.h:195
@ RHN_OPT_ENC_ALG
Key management algorithm, following parameter must be a jwa_alg value.
Definition: rhonabwy.h:197
@ RHN_OPT_CLAIM_RHN_INT_VALUE
Claims Integer value, following parameters must be const char * name, int i_value.
Definition: rhonabwy.h:192
@ RHN_OPT_VERIFY_KEY_JSON_T
Public key in JSON format to verify the token signature, following parameter must be a json_t * value...
Definition: rhonabwy.h:212
@ RHN_OPT_DECRYPT_KEY_GNUTLS
Private key in GnuTLS format to decrypt the token, following parameter must be a gnutls_privkey_t val...
Definition: rhonabwy.h:223
@ RHN_OPT_ENC
Encryption algorithm, following parameter must be a jwa_enc value.
Definition: rhonabwy.h:198
@ RHN_OPT_NONE
End option list, mandatory at the end of the option list.
Definition: rhonabwy.h:181
@ RHN_OPT_PAYLOAD
JSON value to set the entire payload, following parameters must be const unsigned char * value,...
Definition: rhonabwy.h:190
@ RHN_OPT_ENCRYPT_KEY_JWKS
Public key set in JWKS format to encrypt the token, following parameter must be a jwks_t * value.
Definition: rhonabwy.h:216
@ RHN_OPT_ENCRYPT_KEY_JWK
Public key in JWK format to encrypt the token, following parameter must be a jwk_t * value.
Definition: rhonabwy.h:215
@ R_IMPORT_PEM
Import from a X509 key in PEM format, following parameters must be type (R_X509_TYPE_PUBKEY,...
Definition: rhonabwy.h:233
@ R_IMPORT_PASSWORD
Import from a password, following parameter must be a const char * value.
Definition: rhonabwy.h:240
@ R_IMPORT_SYMKEY
Import from a symmetric key, following parameters must be const unsigned char *, size_t.
Definition: rhonabwy.h:239
@ R_IMPORT_JSON_STR
Import from a stringified JSON, following parameter must be a const char * value.
Definition: rhonabwy.h:231
@ R_IMPORT_X5U
Import from an URL pointing to a x5u, following parameters must be x5u_flags (R_FLAG_IGNORE_SERVER_CE...
Definition: rhonabwy.h:238
@ R_IMPORT_JSON_T
Import from a json_t *, following parameter must be a const json_t * value.
Definition: rhonabwy.h:232
@ R_IMPORT_DER
Import from a X509 key in DER format, following parameters must be type (R_X509_TYPE_PUBKEY,...
Definition: rhonabwy.h:234
@ R_IMPORT_JKU
Import from an URL pointing to a jku, available for r_jwks_quick_import only, following parameters mu...
Definition: rhonabwy.h:241
@ R_IMPORT_NONE
End option list, mandatory at the end of the option list when using r_jwks_quick_import.
Definition: rhonabwy.h:230
@ R_IMPORT_G_PUBKEY
Import from a gnutls_pubkey_t, following parameters must be gnutls_pubkey_t.
Definition: rhonabwy.h:236
@ R_IMPORT_G_PRIVKEY
Import from a gnutls_privkey_t, following parameters must be gnutls_privkey_t.
Definition: rhonabwy.h:235
@ R_IMPORT_G_CERT
Import from a gnutls_x509_crt_t, following parameters must be gnutls_x509_crt_t.
Definition: rhonabwy.h:237
@ R_JWT_CLAIM_ISS
Definition: rhonabwy.h:155
@ R_JWT_CLAIM_SUB
Definition: rhonabwy.h:156
@ R_JWT_CLAIM_NBF
Definition: rhonabwy.h:159
@ R_JWT_CLAIM_JSN
Definition: rhonabwy.h:164
@ R_JWT_CLAIM_IAT
Definition: rhonabwy.h:160
@ R_JWT_CLAIM_AMR
Definition: rhonabwy.h:167
@ R_JWT_CLAIM_TYP
Definition: rhonabwy.h:165
@ R_JWT_CLAIM_STR
Definition: rhonabwy.h:162
@ R_JWT_CLAIM_INT
Definition: rhonabwy.h:163
@ R_JWT_CLAIM_EXP
Definition: rhonabwy.h:158
@ R_JWT_CLAIM_NOP
Definition: rhonabwy.h:154
@ R_JWT_CLAIM_AUD
Definition: rhonabwy.h:157
@ R_JWT_CLAIM_CTY
Definition: rhonabwy.h:166
@ R_JWT_CLAIM_JTI
Definition: rhonabwy.h:161
@ R_JWA_ALG_A256KW
Definition: rhonabwy.h:138
@ R_JWA_ALG_A192GCMKW
Definition: rhonabwy.h:145
@ R_JWA_ALG_ES384
Definition: rhonabwy.h:127
@ R_JWA_ALG_A192KW
Definition: rhonabwy.h:137
@ R_JWA_ALG_PBES2_H384
Definition: rhonabwy.h:148
@ R_JWA_ALG_HS384
Definition: rhonabwy.h:121
@ R_JWA_ALG_EDDSA
Definition: rhonabwy.h:129
@ R_JWA_ALG_DIR
Definition: rhonabwy.h:139
@ R_JWA_ALG_A128KW
Definition: rhonabwy.h:136
@ R_JWA_ALG_HS512
Definition: rhonabwy.h:122
@ R_JWA_ALG_PS512
Definition: rhonabwy.h:132
@ R_JWA_ALG_PS384
Definition: rhonabwy.h:131
@ R_JWA_ALG_PBES2_H512
Definition: rhonabwy.h:149
@ R_JWA_ALG_NONE
Definition: rhonabwy.h:119
@ R_JWA_ALG_RSA1_5
Definition: rhonabwy.h:133
@ R_JWA_ALG_ES256
Definition: rhonabwy.h:126
@ R_JWA_ALG_RSA_OAEP_256
Definition: rhonabwy.h:135
@ R_JWA_ALG_A128GCMKW
Definition: rhonabwy.h:144
@ R_JWA_ALG_ECDH_ES_A192KW
Definition: rhonabwy.h:142
@ R_JWA_ALG_ES512
Definition: rhonabwy.h:128
@ R_JWA_ALG_RS512
Definition: rhonabwy.h:125
@ R_JWA_ALG_RS256
Definition: rhonabwy.h:123
@ R_JWA_ALG_A256GCMKW
Definition: rhonabwy.h:146
@ R_JWA_ALG_ES256K
Definition: rhonabwy.h:150
@ R_JWA_ALG_RS384
Definition: rhonabwy.h:124
@ R_JWA_ALG_UNKNOWN
Definition: rhonabwy.h:118
@ R_JWA_ALG_ECDH_ES_A128KW
Definition: rhonabwy.h:141
@ R_JWA_ALG_ECDH_ES
Definition: rhonabwy.h:140
@ R_JWA_ALG_HS256
Definition: rhonabwy.h:120
@ R_JWA_ALG_PS256
Definition: rhonabwy.h:130
@ R_JWA_ALG_PBES2_H256
Definition: rhonabwy.h:147
@ R_JWA_ALG_RSA_OAEP
Definition: rhonabwy.h:134
@ R_JWA_ALG_ECDH_ES_A256KW
Definition: rhonabwy.h:143
json_t * _r_json_get_json_t_value(json_t *j_json, const char *key)
Definition: misc.c:279
int _r_inflate_payload(const unsigned char *compressed, size_t compressed_len, unsigned char **uncompressed, size_t *uncompressed_len)
Definition: misc.c:397
rhn_int_t _r_json_get_int_value(json_t *j_json, const char *key)
Definition: misc.c:272
const char * _r_json_get_str_value(json_t *j_json, const char *key)
Definition: misc.c:265
size_t _r_get_key_size(jwa_enc enc)
Definition: misc.c:295
int _r_deflate_payload(const unsigned char *uncompressed, size_t uncompressed_len, unsigned char **compressed, size_t *compressed_len)
Definition: misc.c:354
json_t * _r_json_get_full_json_t(json_t *j_json)
Definition: misc.c:288
int _r_json_set_json_t_value(json_t *j_json, const char *key, json_t *j_value)
Definition: misc.c:244
int _r_json_set_str_value(json_t *j_json, const char *key, const char *str_value)
Definition: misc.c:207
gnutls_cipher_algorithm_t _r_get_alg_from_enc(jwa_enc enc)
Definition: misc.c:321
int _r_json_set_int_value(json_t *j_json, const char *key, rhn_int_t i_value)
Definition: misc.c:228
Definition: rhonabwy.h:258
size_t payload_len
Definition: rhonabwy.h:278
json_t * j_header
Definition: rhonabwy.h:265
unsigned char * iv
Definition: rhonabwy.h:275
jwa_enc enc
Definition: rhonabwy.h:268
json_t * j_json_serialization
Definition: rhonabwy.h:279
jwks_t * jwks_privkey
Definition: rhonabwy.h:269
unsigned char * iv_b64url
Definition: rhonabwy.h:262
size_t key_len
Definition: rhonabwy.h:274
unsigned char * auth_tag_b64url
Definition: rhonabwy.h:264
unsigned char * aad_b64url
Definition: rhonabwy.h:261
size_t aad_len
Definition: rhonabwy.h:272
unsigned char * header_b64url
Definition: rhonabwy.h:259
unsigned char * ciphertext_b64url
Definition: rhonabwy.h:263
jwa_alg alg
Definition: rhonabwy.h:267
unsigned char * key
Definition: rhonabwy.h:273
unsigned char * aad
Definition: rhonabwy.h:271
jwks_t * jwks_pubkey
Definition: rhonabwy.h:270
unsigned char * payload
Definition: rhonabwy.h:277
size_t iv_len
Definition: rhonabwy.h:276
unsigned char * encrypted_key_b64url
Definition: rhonabwy.h:260
json_t * j_unprotected_header
Definition: rhonabwy.h:266
int token_mode
Definition: rhonabwy.h:280
Definition: rhonabwy.h:244
int token_mode
Definition: rhonabwy.h:255
size_t payload_len
Definition: rhonabwy.h:253
jwks_t * jwks_pubkey
Definition: rhonabwy.h:251
jwks_t * jwks_privkey
Definition: rhonabwy.h:250
unsigned char * payload
Definition: rhonabwy.h:252
json_t * j_json_serialization
Definition: rhonabwy.h:254
unsigned char * payload_b64url
Definition: rhonabwy.h:246
json_t * j_header
Definition: rhonabwy.h:248
unsigned char * signature_b64url
Definition: rhonabwy.h:247
jwa_alg alg
Definition: rhonabwy.h:249
unsigned char * header_b64url
Definition: rhonabwy.h:245
Definition: rhonabwy.h:283
jwa_alg enc_alg
Definition: rhonabwy.h:291
jwks_t * jwks_privkey_sign
Definition: rhonabwy.h:297
json_t * j_claims
Definition: rhonabwy.h:287
jwa_alg sign_alg
Definition: rhonabwy.h:290
jwa_enc enc
Definition: rhonabwy.h:292
size_t key_len
Definition: rhonabwy.h:294
jwks_t * jwks_pubkey_enc
Definition: rhonabwy.h:300
int type
Definition: rhonabwy.h:284
unsigned char * iv
Definition: rhonabwy.h:295
jws_t * jws
Definition: rhonabwy.h:288
jwks_t * jwks_privkey_enc
Definition: rhonabwy.h:299
jwe_t * jwe
Definition: rhonabwy.h:289
unsigned char * key
Definition: rhonabwy.h:293
json_t * j_header
Definition: rhonabwy.h:286
size_t iv_len
Definition: rhonabwy.h:296
uint32_t parse_flags
Definition: rhonabwy.h:285
jwks_t * jwks_pubkey_sign
Definition: rhonabwy.h:298