Rhonabwy
Create, modify, parse or export Json Web Keys as defined in the RFC 7517
rhonabwy.h
Go to the documentation of this file.
1 
25 #ifndef __RHONABWY_H_
26 #define __RHONABWY_H_
27 
28 #ifdef __cplusplus
29 extern "C"
30 {
31 #endif
32 
33 #include "rhonabwy-cfg.h"
34 
35 #include <jansson.h>
36 #include <gnutls/gnutls.h>
37 
44 #define RHN_OK 0
45 #define RHN_ERROR 1
46 #define RHN_ERROR_MEMORY 2
47 #define RHN_ERROR_PARAM 3
48 #define RHN_ERROR_UNSUPPORTED 4
49 #define RHN_ERROR_INVALID 5
50 
51 #define R_X509_TYPE_PUBKEY 1
52 #define R_X509_TYPE_PRIVKEY 2
53 #define R_X509_TYPE_CERTIFICATE 3
54 
55 #define R_FORMAT_PEM 0
56 #define R_FORMAT_DER 1
57 
58 #define R_KEY_TYPE_NONE 0x00000000
59 #define R_KEY_TYPE_PUBLIC 0x00000001
60 #define R_KEY_TYPE_PRIVATE 0x00000010
61 #define R_KEY_TYPE_SYMMETRIC 0x00000100
62 #define R_KEY_TYPE_RSA 0x00001000
63 #define R_KEY_TYPE_ECDSA 0x00010000
64 #define R_KEY_TYPE_HMAC 0x00100000
65 #define R_KEY_TYPE_EDDSA 0x01000000
66 
67 #define R_FLAG_IGNORE_SERVER_CERTIFICATE 0x00000001
68 #define R_FLAG_FOLLOW_REDIRECT 0x00000010
69 #define R_FLAG_IGNORE_REMOTE 0x00000100
70 
71 #define R_JWT_TYPE_NONE 0
72 #define R_JWT_TYPE_SIGN 1
73 #define R_JWT_TYPE_ENCRYPT 2
74 #define R_JWT_TYPE_NESTED_SIGN_THEN_ENCRYPT 3
75 #define R_JWT_TYPE_NESTED_ENCRYPT_THEN_SIGN 4
76 
77 #define R_JWT_CLAIM_NOP 0
78 #define R_JWT_CLAIM_ISS 1
79 #define R_JWT_CLAIM_SUB 2
80 #define R_JWT_CLAIM_AUD 3
81 #define R_JWT_CLAIM_EXP 4
82 #define R_JWT_CLAIM_NBF 5
83 #define R_JWT_CLAIM_IAT 6
84 #define R_JWT_CLAIM_JTI 7
85 #define R_JWT_CLAIM_STR 8
86 #define R_JWT_CLAIM_INT 9
87 #define R_JWT_CLAIM_JSN 10
88 
89 #define R_JWT_CLAIM_NOW -1
90 #define R_JWT_CLAIM_PRESENT -2
91 
102 typedef json_t jwk_t;
103 typedef json_t jwks_t;
104 
105 typedef enum {
138 } jwa_alg;
139 
140 typedef enum {
148 } jwa_enc;
149 
150 typedef struct {
151  unsigned char * header_b64url;
152  unsigned char * payload_b64url;
153  unsigned char * signature_b64url;
154  json_t * j_header;
158  unsigned char * payload;
159  size_t payload_len;
160 } jws_t;
161 
162 typedef struct {
163  unsigned char * header_b64url;
164  unsigned char * encrypted_key_b64url;
165  unsigned char * iv_b64url;
166  unsigned char * ciphertext_b64url;
167  unsigned char * auth_tag_b64url;
168  json_t * j_header;
173  unsigned char * key;
174  size_t key_len;
175  unsigned char * iv;
176  size_t iv_len;
177  unsigned char * payload;
178  size_t payload_len;
179 } jwe_t;
180 
181 typedef struct {
182  int type;
183  json_t * j_header;
184  json_t * j_claims;
194 } jwt_t;
195 
214 json_t * r_library_info_json_t();
215 
223 char * r_library_info_json_str();
224 
230 void r_free(void * data);
231 
237 int r_jwk_init(jwk_t ** jwk);
238 
243 void r_jwk_free(jwk_t * jwk);
244 
250 int r_jwks_init(jwks_t ** jwks);
251 
256 void r_jwks_free(jwks_t * jwks);
257 
263 int r_jws_init(jws_t ** jws);
264 
269 void r_jws_free(jws_t * jws);
270 
276 int r_jwe_init(jwe_t ** jwe);
277 
282 void r_jwe_free(jwe_t * jwe);
283 
289 int r_jwt_init(jwt_t ** jwt);
290 
295 void r_jwt_free(jwt_t * jwt);
296 
302 jwa_alg r_str_to_jwa_alg(const char * alg);
303 
310 const char * r_jwa_alg_to_str(jwa_alg alg);
311 
317 jwa_enc r_str_to_jwa_enc(const char * enc);
318 
325 const char * r_jwa_enc_to_str(jwa_enc enc);
326 
362 int r_jwk_key_type(jwk_t * jwk, unsigned int * bits, int x5u_flags);
363 
370 int r_jwk_is_valid(jwk_t * jwk);
371 
383 int r_jwk_generate_key_pair(jwk_t * jwk_privkey, jwk_t * jwk_pubkey, int type, unsigned int bits, const char * kid);
384 
401 const char * r_jwk_get_property_str(jwk_t * jwk, const char * key);
402 
410 const char * r_jwk_get_property_array(jwk_t * jwk, const char * key, size_t index);
411 
420 int r_jwk_set_property_str(jwk_t * jwk, const char * key, const char * value);
421 
431 int r_jwk_set_property_array(jwk_t * jwk, const char * key, size_t index, const char * value);
432 
441 int r_jwk_append_property_array(jwk_t * jwk, const char * key, const char * value);
442 
450 int r_jwk_delete_property_str(jwk_t * jwk, const char * key);
451 
460 int r_jwk_delete_property_array_at(jwk_t * jwk, const char * key, size_t index);
461 
479 int r_jwk_import_from_json_str(jwk_t * jwk, const char * input);
480 
488 int r_jwk_import_from_json_t(jwk_t * jwk, json_t * j_input);
489 
500 int r_jwk_import_from_pem_der(jwk_t * jwk, int type, int format, const unsigned char * input, size_t input_len);
501 
509 int r_jwk_import_from_gnutls_privkey(jwk_t * jwk, gnutls_privkey_t key);
510 
518 int r_jwk_import_from_gnutls_pubkey(jwk_t * jwk, gnutls_pubkey_t pub);
519 
527 int r_jwk_import_from_gnutls_x509_crt(jwk_t * jwk, gnutls_x509_crt_t crt);
528 
541 int r_jwk_import_from_x5u(jwk_t * jwk, int type, int x5u_flags, const char * x5u);
542 
551 int r_jwk_import_from_symmetric_key(jwk_t * jwk, const unsigned char * key, size_t key_len);
552 
565 int r_jwk_extract_pubkey(jwk_t * jwk_privkey, jwk_t * jwk_pubkey, int x5u_flags);
566 
572 jwk_t * r_jwk_copy(jwk_t * jwk);
573 
580 int r_jwk_equal(jwk_t * jwk1, jwk_t * jwk2);
581 
598 char * r_jwk_export_to_json_str(jwk_t * jwk, int pretty);
599 
605 json_t * r_jwk_export_to_json_t(jwk_t * jwk);
606 
618 gnutls_privkey_t r_jwk_export_to_gnutls_privkey(jwk_t * jwk, int x5u_flags);
619 
631 gnutls_pubkey_t r_jwk_export_to_gnutls_pubkey(jwk_t * jwk, int x5u_flags);
632 
646 gnutls_x509_crt_t r_jwk_export_to_gnutls_crt(jwk_t * jwk, int x5u_flags);
647 
663 int r_jwk_export_to_pem_der(jwk_t * jwk, int format, unsigned char * output, size_t * output_len, int x5u_flags);
664 
673 int r_jwk_export_to_symmetric_key(jwk_t * jwk, unsigned char * key, size_t * key_len);
674 
692 int r_jwks_is_valid(jwks_t * jwks);
693 
703 int r_jwks_import_from_str(jwks_t * jwks, const char * input);
704 
714 int r_jwks_import_from_json_t(jwks_t * jwks, json_t * j_input);
715 
729 int r_jwks_import_from_uri(jwks_t * jwks, const char * uri, int flags);
730 
736 jwks_t * r_jwks_copy(jwks_t * jwks);
737 
743 size_t r_jwks_size(jwks_t * jwks);
744 
752 jwk_t * r_jwks_get_at(jwks_t * jwks, size_t index);
753 
761 jwk_t * r_jwks_get_by_kid(jwks_t * jwks, const char * kid);
762 
769 int r_jwks_append_jwk(jwks_t * jwks, jwk_t * jwk);
770 
778 int r_jwks_set_at(jwks_t * jwks, size_t index, jwk_t * jwk);
779 
786 int r_jwks_remove_at(jwks_t * jwks, size_t index);
787 
793 int r_jwks_empty(jwks_t * jwks);
794 
802 int r_jwks_equal(jwks_t * jwks1, jwks_t * jwks2);
803 
810 char * r_jwks_export_to_json_str(jwks_t * jwks, int pretty);
811 
817 json_t * r_jwks_export_to_json_t(jwks_t * jwks);
818 
832 gnutls_privkey_t * r_jwks_export_to_gnutls_privkey(jwks_t * jwks, size_t * len, int x5u_flags);
833 
846 gnutls_pubkey_t * r_jwks_export_to_gnutls_pubkey(jwks_t * jwks, size_t * len, int x5u_flags);
847 
863 int r_jwks_export_to_pem_der(jwks_t * jwks, int format, unsigned char * output, size_t * output_len, int x5u_flags);
864 
880 jws_t * r_jws_copy(jws_t * jws);
881 
889 int r_jws_set_payload(jws_t * jws, const unsigned char * payload, size_t payload_len);
890 
897 const unsigned char * r_jws_get_payload(jws_t * jws, size_t * payload_len);
898 
905 int r_jws_set_alg(jws_t * jws, jwa_alg alg);
906 
913 
921 int r_jws_set_header_str_value(jws_t * jws, const char * key, const char * str_value);
922 
930 int r_jws_set_header_int_value(jws_t * jws, const char * key, int i_value);
931 
939 int r_jws_set_header_json_t_value(jws_t * jws, const char * key, json_t * j_value);
940 
947 const char * r_jws_get_header_str_value(jws_t * jws, const char * key);
948 
955 int r_jws_get_header_int_value(jws_t * jws, const char * key);
956 
963 json_t * r_jws_get_header_json_t_value(jws_t * jws, const char * key);
964 
970 json_t * r_jws_get_full_header_json_t(jws_t * jws);
971 
979 int r_jws_add_keys(jws_t * jws, jwk_t * jwk_privkey, jwk_t * jwk_pubkey);
980 
988 int r_jws_add_jwks(jws_t * jws, jwks_t * jwks_privkey, jwks_t * jwks_pubkey);
989 
998 int r_jws_add_keys_json_str(jws_t * jws, const char * privkey, const char * pubkey);
999 
1008 int r_jws_add_keys_json_t(jws_t * jws, json_t * privkey, json_t * pubkey);
1009 
1021 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);
1022 
1031 int r_jws_add_keys_gnutls(jws_t * jws, gnutls_privkey_t privkey, gnutls_pubkey_t pubkey);
1032 
1040 int r_jws_add_key_symmetric(jws_t * jws, const unsigned char * key, size_t key_len);
1041 
1048 
1055 
1068 int r_jws_parse(jws_t * jws, const char * jws_str, int x5u_flags);
1069 
1083 int r_jws_parsen(jws_t * jws, const char * jws_str, size_t jws_str_len, int x5u_flags);
1084 
1100 int r_jws_verify_signature(jws_t * jws, jwk_t * jwk_pubkey, int x5u_flags);
1101 
1115 char * r_jws_serialize(jws_t * jws, jwk_t * jwk_privkey, int x5u_flags);
1116 
1132 jwe_t * r_jwe_copy(jwe_t * jwe);
1133 
1141 int r_jwe_set_payload(jwe_t * jwe, const unsigned char * payload, size_t payload_len);
1142 
1149 const unsigned char * r_jwe_get_payload(jwe_t * jwe, size_t * payload_len);
1150 
1157 int r_jwe_set_alg(jwe_t * jwe, jwa_alg alg);
1158 
1164 jwa_alg r_jwe_get_alg(jwe_t * jwe);
1165 
1172 int r_jwe_set_enc(jwe_t * jwe, jwa_enc enc);
1173 
1179 jwa_enc r_jwe_get_enc(jwe_t * jwe);
1180 
1188 int r_jwe_set_header_str_value(jwe_t * jwe, const char * key, const char * str_value);
1189 
1197 int r_jwe_set_header_int_value(jwe_t * jwe, const char * key, int i_value);
1198 
1206 int r_jwe_set_header_json_t_value(jwe_t * jwe, const char * key, json_t * j_value);
1207 
1214 const char * r_jwe_get_header_str_value(jwe_t * jwe, const char * key);
1215 
1222 int r_jwe_get_header_int_value(jwe_t * jwe, const char * key);
1223 
1230 json_t * r_jwe_get_header_json_t_value(jwe_t * jwe, const char * key);
1231 
1237 json_t * r_jwe_get_full_header_json_t(jwe_t * jwe);
1238 
1246 int r_jwe_add_keys(jwe_t * jwe, jwk_t * jwk_privkey, jwk_t * jwk_pubkey);
1247 
1255 int r_jwe_add_jwks(jwe_t * jwe, jwks_t * jwks_privkey, jwks_t * jwks_pubkey);
1256 
1265 int r_jwe_add_keys_json_str(jwe_t * jwe, const char * privkey, const char * pubkey);
1266 
1275 int r_jwe_add_keys_json_t(jwe_t * jwe, json_t * privkey, json_t * pubkey);
1276 
1288 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);
1289 
1298 int r_jwe_add_keys_gnutls(jwe_t * jwe, gnutls_privkey_t privkey, gnutls_pubkey_t pubkey);
1299 
1307 int r_jwe_add_key_symmetric(jwe_t * jwe, const unsigned char * key, size_t key_len);
1308 
1315 
1322 
1330 int r_jwe_set_cypher_key(jwe_t * jwe, const unsigned char * key, size_t key_len);
1331 
1338 const unsigned char * r_jwe_get_cypher_key(jwe_t * jwe, size_t * key_len);
1339 
1345 int r_jwe_generate_cypher_key(jwe_t * jwe);
1346 
1354 int r_jwe_set_iv(jwe_t * jwe, const unsigned char * iv, size_t iv_len);
1355 
1362 const unsigned char * r_jwe_get_iv(jwe_t * jwe, size_t * iv_len);
1363 
1369 int r_jwe_generate_iv(jwe_t * jwe);
1370 
1376 int r_jwe_encrypt_payload(jwe_t * jwe);
1377 
1383 int r_jwe_decrypt_payload(jwe_t * jwe);
1384 
1397 int r_jwe_encrypt_key(jwe_t * jwe, jwk_t * jwk_pubkey, int x5u_flags);
1398 
1411 int r_jwe_decrypt_key(jwe_t * jwe, jwk_t * jwk_privkey, int x5u_flags);
1412 
1425 int r_jwe_parse(jwe_t * jwe, const char * jwe_str, int x5u_flags);
1426 
1440 int r_jwe_parsen(jwe_t * jwe, const char * jwe_str, size_t jwe_str_len, int x5u_flags);
1441 
1455 int r_jwe_decrypt(jwe_t * jwe, jwk_t * jwk_privkey, int x5u_flags);
1456 
1470 char * r_jwe_serialize(jwe_t * jwe, jwk_t * jwk_pubkey, int x5u_flags);
1471 
1487 jwt_t * r_jwt_copy(jwt_t * jwt);
1488 
1496 int r_jwt_set_header_str_value(jwt_t * jwt, const char * key, const char * str_value);
1497 
1505 int r_jwt_set_header_int_value(jwt_t * jwt, const char * key, int i_value);
1506 
1514 int r_jwt_set_header_json_t_value(jwt_t * jwt, const char * key, json_t * j_value);
1515 
1522 const char * r_jwt_get_header_str_value(jwt_t * jwt, const char * key);
1523 
1530 int r_jwt_get_header_int_value(jwt_t * jwt, const char * key);
1531 
1538 json_t * r_jwt_get_header_json_t_value(jwt_t * jwt, const char * key);
1539 
1545 json_t * r_jwt_get_full_header_json_t(jwt_t * jwt);
1546 
1552 char * r_jwt_get_full_header_str(jwt_t * jwt);
1553 
1561 int r_jwt_set_claim_str_value(jwt_t * jwt, const char * key, const char * str_value);
1562 
1570 int r_jwt_set_claim_int_value(jwt_t * jwt, const char * key, int i_value);
1571 
1579 int r_jwt_set_claim_json_t_value(jwt_t * jwt, const char * key, json_t * j_value);
1580 
1587 const char * r_jwt_get_claim_str_value(jwt_t * jwt, const char * key);
1588 
1595 int r_jwt_get_claim_int_value(jwt_t * jwt, const char * key);
1596 
1603 json_t * r_jwt_get_claim_json_t_value(jwt_t * jwt, const char * key);
1604 
1610 json_t * r_jwt_get_full_claims_json_t(jwt_t * jwt);
1611 
1617 char * r_jwt_get_full_claims_str(jwt_t * jwt);
1618 
1626 int r_jwt_set_full_claims_json_t(jwt_t * jwt, json_t * j_claim);
1627 
1635 int r_jwt_set_full_claims_json_str(jwt_t * jwt, const char * str_claims);
1636 
1644 int r_jwt_append_claims_json_t(jwt_t * jwt, json_t * j_claim);
1645 
1653 int r_jwt_add_sign_keys(jwt_t * jwt, jwk_t * privkey, jwk_t * pubkey);
1654 
1662 int r_jwt_add_sign_jwks(jwt_t * jwt, jwks_t * jwks_privkey, jwks_t * jwks_pubkey);
1663 
1672 int r_jwt_add_sign_keys_json_str(jwt_t * jwt, const char * privkey, const char * pubkey);
1673 
1682 int r_jwt_add_sign_keys_json_t(jwt_t * jwt, json_t * privkey, json_t * pubkey);
1683 
1695 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);
1696 
1705 int r_jwt_add_sign_keys_gnutls(jwt_t * jwt, gnutls_privkey_t privkey, gnutls_pubkey_t pubkey);
1706 
1714 int r_jwt_add_sign_key_symmetric(jwt_t * jwt, const unsigned char * key, size_t key_len);
1715 
1722 
1729 
1737 int r_jwt_add_enc_keys(jwt_t * jwt, jwk_t * privkey, jwk_t * pubkey);
1738 
1746 int r_jwt_add_enc_jwks(jwt_t * jwt, jwks_t * jwks_privkey, jwks_t * jwks_pubkey);
1747 
1756 int r_jwt_add_enc_keys_json_str(jwt_t * jwt, const char * privkey, const char * pubkey);
1757 
1766 int r_jwt_add_enc_keys_json_t(jwt_t * jwt, json_t * privkey, json_t * pubkey);
1767 
1779 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);
1780 
1789 int r_jwt_add_enc_keys_gnutls(jwt_t * jwt, gnutls_privkey_t privkey, gnutls_pubkey_t pubkey);
1790 
1798 int r_jwt_add_enc_key_symmetric(jwt_t * jwt, const unsigned char * key, size_t key_len);
1799 
1806 
1813 
1820 int r_jwt_set_sign_alg(jwt_t * jwt, jwa_alg alg);
1821 
1828 
1835 int r_jwt_set_enc_alg(jwt_t * jwt, jwa_alg alg);
1836 
1843 
1850 int r_jwt_set_enc(jwt_t * jwt, jwa_enc enc);
1851 
1857 jwa_enc r_jwt_get_enc(jwt_t * jwt);
1858 
1871 char * r_jwt_serialize_signed(jwt_t * jwt, jwk_t * privkey, int x5u_flags);
1872 
1885 char * r_jwt_serialize_encrypted(jwt_t * jwt, jwk_t * pubkey, int x5u_flags);
1886 
1911 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);
1912 
1928 int r_jwt_parse(jwt_t * jwt, const char * token, int x5u_flags);
1929 
1946 int r_jwt_parsen(jwt_t * jwt, const char * token, size_t token_len, int x5u_flags);
1947 
1958 int r_jwt_get_type(jwt_t * jwt);
1959 
1975 int r_jwt_verify_signature(jwt_t * jwt, jwk_t * pubkey, int x5u_flags);
1976 
1990 int r_jwt_decrypt(jwt_t * jwt, jwk_t * privkey, int x5u_flags);
1991 
2014 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);
2015 
2030 int r_jwt_decrypt_nested(jwt_t * jwt, jwk_t * decrypt_key, int decrypt_key_x5u_flags);
2031 
2045 int r_jwt_verify_signature_nested(jwt_t * jwt, jwk_t * verify_key, int verify_key_x5u_flags);
2046 
2073 int r_jwt_validate_claims(jwt_t * jwt, ...);
2074 
2079 #ifndef DOXYGEN_SHOULD_SKIP_THIS
2080 
2084 int _r_json_set_str_value(json_t * j_json, const char * key, const char * str_value);
2085 
2086 int _r_json_set_int_value(json_t * j_json, const char * key, int i_value);
2087 
2088 int _r_json_set_json_t_value(json_t * j_json, const char * key, json_t * j_value);
2089 
2090 const char * _r_json_get_str_value(json_t * j_json, const char * key);
2091 
2092 int _r_json_get_int_value(json_t * j_json, const char * key);
2093 
2094 json_t * _r_json_get_json_t_value(json_t * j_json, const char * key);
2095 
2096 json_t * _r_json_get_full_json_t(json_t * j_json);
2097 
2098 #endif
2099 
2100 #ifdef __cplusplus
2101 }
2102 #endif
2103 
2104 #endif // __RHONABWY_H_
r_jwt_verify_signature
int r_jwt_verify_signature(jwt_t *jwt, jwk_t *pubkey, int x5u_flags)
Definition: jwt.c:1156
R_JWA_ALG_ES256
@ R_JWA_ALG_ES256
Definition: rhonabwy.h:114
jwe_t::payload
unsigned char * payload
Definition: rhonabwy.h:177
r_jwe_copy
jwe_t * r_jwe_copy(jwe_t *jwe)
Definition: jwe.c:529
r_jwt_verify_signature_nested
int r_jwt_verify_signature_nested(jwt_t *jwt, jwk_t *verify_key, int verify_key_x5u_flags)
Definition: jwt.c:1476
R_JWA_ALG_NONE
@ R_JWA_ALG_NONE
Definition: rhonabwy.h:107
R_JWA_ENC_A128GCM
@ R_JWA_ENC_A128GCM
Definition: rhonabwy.h:145
r_jwks_free
void r_jwks_free(jwks_t *jwks)
Definition: jwks.c:40
r_jwe_parse
int r_jwe_parse(jwe_t *jwe, const char *jwe_str, int x5u_flags)
Definition: jwe.c:1851
r_jwt_get_sign_alg
jwa_alg r_jwt_get_sign_alg(jwt_t *jwt)
Definition: jwt.c:812
r_jws_set_header_json_t_value
int r_jws_set_header_json_t_value(jws_t *jws, const char *key, json_t *j_value)
Definition: jws.c:810
r_jwks_import_from_json_t
int r_jwks_import_from_json_t(jwks_t *jwks, json_t *j_input)
Definition: jwks.c:270
r_jwt_free
void r_jwt_free(jwt_t *jwt)
Definition: jwt.c:84
r_jws_free
void r_jws_free(jws_t *jws)
Definition: jws.c:639
r_jwks_append_jwk
int r_jwks_append_jwk(jwks_t *jwks, jwk_t *jwk)
Definition: jwks.c:104
r_jwe_set_enc
int r_jwe_set_enc(jwe_t *jwe, jwa_enc enc)
Definition: jwe.c:825
r_jwks_export_to_json_t
json_t * r_jwks_export_to_json_t(jwks_t *jwks)
Definition: jwks.c:168
R_JWA_ENC_UNKNOWN
@ R_JWA_ENC_UNKNOWN
Definition: rhonabwy.h:141
r_jwt_add_sign_keys_json_str
int r_jwt_add_sign_keys_json_str(jwt_t *jwt, const char *privkey, const char *pubkey)
Definition: jwt.c:347
jwe_t::jwks_pubkey
jwks_t * jwks_pubkey
Definition: rhonabwy.h:172
r_jwk_import_from_symmetric_key
int r_jwk_import_from_symmetric_key(jwk_t *jwk, const unsigned char *key, size_t key_len)
Definition: jwk.c:1409
jws_t::header_b64url
unsigned char * header_b64url
Definition: rhonabwy.h:151
R_JWA_ENC_A192CBC
@ R_JWA_ENC_A192CBC
Definition: rhonabwy.h:143
r_jwk_export_to_json_str
char * r_jwk_export_to_json_str(jwk_t *jwk, int pretty)
Definition: jwk.c:1450
r_jwk_key_type
int r_jwk_key_type(jwk_t *jwk, unsigned int *bits, int x5u_flags)
Definition: jwk.c:392
r_jwk_get_property_str
const char * r_jwk_get_property_str(jwk_t *jwk, const char *key)
Definition: jwk.c:2211
R_JWA_ALG_A128KW
@ R_JWA_ALG_A128KW
Definition: rhonabwy.h:124
R_JWA_ALG_DIR
@ R_JWA_ALG_DIR
Definition: rhonabwy.h:127
r_jwt_copy
jwt_t * r_jwt_copy(jwt_t *jwt)
Definition: jwt.c:98
r_jws_verify_signature
int r_jws_verify_signature(jws_t *jws, jwk_t *jwk_pubkey, int x5u_flags)
Definition: jws.c:1211
jwt_t
Definition: rhonabwy.h:181
r_jwks_export_to_gnutls_pubkey
gnutls_pubkey_t * r_jwks_export_to_gnutls_pubkey(jwks_t *jwks, size_t *len, int x5u_flags)
Definition: jwks.c:198
jwe_t::alg
jwa_alg alg
Definition: rhonabwy.h:169
r_jwt_serialize_encrypted
char * r_jwt_serialize_encrypted(jwt_t *jwt, jwk_t *pubkey, int x5u_flags)
Definition: jwt.c:901
r_jwe_serialize
char * r_jwe_serialize(jwe_t *jwe, jwk_t *jwk_pubkey, int x5u_flags)
Definition: jwe.c:1867
r_jwk_get_property_array
const char * r_jwk_get_property_array(jwk_t *jwk, const char *key, size_t index)
Definition: jwk.c:2223
r_jwt_get_enc_alg
jwa_alg r_jwt_get_enc_alg(jwt_t *jwt)
Definition: jwt.c:832
r_jwt_add_sign_keys_json_t
int r_jwt_add_sign_keys_json_t(jwt_t *jwt, json_t *privkey, json_t *pubkey)
Definition: jwt.c:386
jwt_t::type
int type
Definition: rhonabwy.h:182
jws_t
Definition: rhonabwy.h:150
r_jwt_get_enc_jwks_privkey
jwks_t * r_jwt_get_enc_jwks_privkey(jwt_t *jwt)
Definition: jwt.c:784
r_str_to_jwa_enc
jwa_enc r_str_to_jwa_enc(const char *enc)
Definition: misc.c:285
r_jws_add_keys_json_str
int r_jws_add_keys_json_str(jws_t *jws, const char *privkey, const char *pubkey)
Definition: jws.c:912
jwt_t::jwks_privkey_enc
jwks_t * jwks_privkey_enc
Definition: rhonabwy.h:192
r_jwks_get_by_kid
jwk_t * r_jwks_get_by_kid(jwks_t *jwks, const char *kid)
Definition: jwks.c:83
r_jwe_set_header_int_value
int r_jwe_set_header_int_value(jwe_t *jwe, const char *key, int i_value)
Definition: jwe.c:883
r_jwe_set_iv
int r_jwe_set_iv(jwe_t *jwe, const unsigned char *iv, size_t iv_len)
Definition: jwe.c:663
r_jwks_export_to_gnutls_privkey
gnutls_privkey_t * r_jwks_export_to_gnutls_privkey(jwks_t *jwks, size_t *len, int x5u_flags)
Definition: jwks.c:176
r_jwe_add_keys_gnutls
int r_jwe_add_keys_gnutls(jwe_t *jwe, gnutls_privkey_t privkey, gnutls_pubkey_t pubkey)
Definition: jwe.c:1116
r_jwks_equal
int r_jwks_equal(jwks_t *jwks1, jwks_t *jwks2)
Definition: jwks.c:156
r_jwt_get_header_int_value
int r_jwt_get_header_int_value(jwt_t *jwt, const char *key)
Definition: jwt.c:154
r_jwt_get_enc
jwa_enc r_jwt_get_enc(jwt_t *jwt)
Definition: jwt.c:852
r_jws_parse
int r_jws_parse(jws_t *jws, const char *jws_str, int x5u_flags)
Definition: jws.c:1207
jws_t::signature_b64url
unsigned char * signature_b64url
Definition: rhonabwy.h:153
jwe_t::enc
jwa_enc enc
Definition: rhonabwy.h:170
r_jwt_set_enc
int r_jwt_set_enc(jwt_t *jwt, jwa_enc enc)
Definition: jwt.c:840
r_jwk_export_to_pem_der
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:2127
r_jwks_import_from_str
int r_jwks_import_from_str(jwks_t *jwks, const char *input)
Definition: jwks.c:247
r_jwt_get_enc_jwks_pubkey
jwks_t * r_jwt_get_enc_jwks_pubkey(jwt_t *jwt)
Definition: jwt.c:792
r_jwk_import_from_x5u
int r_jwk_import_from_x5u(jwk_t *jwk, int type, int x5u_flags, const char *x5u)
Definition: jwk.c:1373
R_JWA_ALG_PS512
@ R_JWA_ALG_PS512
Definition: rhonabwy.h:120
r_jwe_set_payload
int r_jwe_set_payload(jwe_t *jwe, const unsigned char *payload, size_t payload_len)
Definition: jwe.c:561
r_jwe_generate_iv
int r_jwe_generate_iv(jwe_t *jwe)
Definition: jwe.c:700
r_jwt_set_header_str_value
int r_jwt_set_header_str_value(jwt_t *jwt, const char *key, const char *str_value)
Definition: jwt.c:123
r_library_info_json_str
char * r_library_info_json_str()
Definition: misc.c:369
r_jwe_get_enc
jwa_enc r_jwe_get_enc(jwe_t *jwe)
Definition: jwe.c:861
r_jwk_equal
int r_jwk_equal(jwk_t *jwk1, jwk_t *jwk2)
Definition: jwk.c:1446
r_jwt_add_enc_keys_pem_der
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:681
jwks_t
json_t jwks_t
Definition: rhonabwy.h:103
r_jws_add_keys_pem_der
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:990
R_JWA_ALG_RS512
@ R_JWA_ALG_RS512
Definition: rhonabwy.h:113
R_JWA_ALG_HS512
@ R_JWA_ALG_HS512
Definition: rhonabwy.h:110
r_jwt_set_enc_alg
int r_jwt_set_enc_alg(jwt_t *jwt, jwa_alg alg)
Definition: jwt.c:820
r_jws_add_jwks
int r_jws_add_jwks(jws_t *jws, jwks_t *jwks_privkey, jwks_t *jwks_pubkey)
Definition: jws.c:879
r_jwk_import_from_pem_der
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:664
r_jwt_decrypt_nested
int r_jwt_decrypt_nested(jwt_t *jwt, jwk_t *decrypt_key, int decrypt_key_x5u_flags)
Definition: jwt.c:1379
jwe_t::encrypted_key_b64url
unsigned char * encrypted_key_b64url
Definition: rhonabwy.h:164
r_jwk_copy
jwk_t * r_jwk_copy(jwk_t *jwk)
Definition: jwk.c:1438
jwe_t::jwks_privkey
jwks_t * jwks_privkey
Definition: rhonabwy.h:171
jwe_t::ciphertext_b64url
unsigned char * ciphertext_b64url
Definition: rhonabwy.h:166
r_jwt_add_sign_key_symmetric
int r_jwt_add_sign_key_symmetric(jwt_t *jwt, const unsigned char *key, size_t key_len)
Definition: jwt.c:503
r_jws_get_full_header_json_t
json_t * r_jws_get_full_header_json_t(jws_t *jws)
Definition: jws.c:846
r_jwt_get_full_header_str
char * r_jwt_get_full_header_str(jwt_t *jwt)
Definition: jwt.c:175
R_JWA_ALG_PS256
@ R_JWA_ALG_PS256
Definition: rhonabwy.h:118
r_jwe_generate_cypher_key
int r_jwe_generate_cypher_key(jwe_t *jwe)
Definition: jwe.c:635
r_jwk_extract_pubkey
int r_jwk_extract_pubkey(jwk_t *jwk_privkey, jwk_t *jwk_pubkey, int x5u_flags)
Definition: jwk.c:592
r_jwa_enc_to_str
const char * r_jwa_enc_to_str(jwa_enc enc)
Definition: misc.c:303
r_jwt_get_claim_str_value
const char * r_jwt_get_claim_str_value(jwt_t *jwt, const char *key)
Definition: jwt.c:207
r_jwt_set_sign_alg
int r_jwt_set_sign_alg(jwt_t *jwt, jwa_alg alg)
Definition: jwt.c:800
r_jwks_is_valid
int r_jwks_is_valid(jwks_t *jwks)
Definition: jwks.c:46
jwt_t::j_claims
json_t * j_claims
Definition: rhonabwy.h:184
jwe_t::iv_len
size_t iv_len
Definition: rhonabwy.h:176
r_jwt_set_header_int_value
int r_jwt_set_header_int_value(jwt_t *jwt, const char *key, int i_value)
Definition: jwt.c:131
R_JWA_ALG_PBES2_H384
@ R_JWA_ALG_PBES2_H384
Definition: rhonabwy.h:136
r_jwe_decrypt_key
int r_jwe_decrypt_key(jwe_t *jwe, jwk_t *jwk_privkey, int x5u_flags)
Definition: jwe.c:1618
r_jwks_remove_at
int r_jwks_remove_at(jwks_t *jwks, size_t index)
Definition: jwks.c:130
jwe_t::payload_len
size_t payload_len
Definition: rhonabwy.h:178
r_jwe_add_key_symmetric
int r_jwe_add_key_symmetric(jwe_t *jwe, const unsigned char *key, size_t key_len)
Definition: jwe.c:1155
r_jwe_encrypt_key
int r_jwe_encrypt_key(jwe_t *jwe, jwk_t *jwk_pubkey, int x5u_flags)
Definition: jwe.c:1494
r_jwe_get_jwks_pubkey
jwks_t * r_jwe_get_jwks_pubkey(jwe_t *jwe)
Definition: jwe.c:1188
r_jwt_parsen
int r_jwt_parsen(jwt_t *jwt, const char *token, size_t token_len, int x5u_flags)
Definition: jwt.c:1018
r_jws_add_keys_gnutls
int r_jws_add_keys_gnutls(jws_t *jws, gnutls_privkey_t privkey, gnutls_pubkey_t pubkey)
Definition: jws.c:1029
r_jwt_set_claim_int_value
int r_jwt_set_claim_int_value(jwt_t *jwt, const char *key, int i_value)
Definition: jwt.c:191
r_jwe_set_header_json_t_value
int r_jwe_set_header_json_t_value(jwe_t *jwe, const char *key, json_t *j_value)
Definition: jwe.c:897
R_JWA_ALG_UNKNOWN
@ R_JWA_ALG_UNKNOWN
Definition: rhonabwy.h:106
jwt_t::enc
jwa_enc enc
Definition: rhonabwy.h:189
_r_json_get_str_value
const char * _r_json_get_str_value(json_t *j_json, const char *key)
Definition: misc.c:86
r_jwk_set_property_array
int r_jwk_set_property_array(jwk_t *jwk, const char *key, size_t index, const char *value)
Definition: jwk.c:2249
R_JWA_ALG_A192KW
@ R_JWA_ALG_A192KW
Definition: rhonabwy.h:125
r_jwt_add_sign_keys_gnutls
int r_jwt_add_sign_keys_gnutls(jwt_t *jwt, gnutls_privkey_t privkey, gnutls_pubkey_t pubkey)
Definition: jwt.c:464
R_JWA_ENC_A192GCM
@ R_JWA_ENC_A192GCM
Definition: rhonabwy.h:146
R_JWA_ENC_A256CBC
@ R_JWA_ENC_A256CBC
Definition: rhonabwy.h:144
r_jwt_get_full_claims_json_t
json_t * r_jwt_get_full_claims_json_t(jwt_t *jwt)
Definition: jwt.c:228
jwt_t::sign_alg
jwa_alg sign_alg
Definition: rhonabwy.h:187
jwa_enc
jwa_enc
Definition: rhonabwy.h:140
r_jwt_decrypt
int r_jwt_decrypt(jwt_t *jwt, jwk_t *privkey, int x5u_flags)
Definition: jwt.c:1181
r_jwe_init
int r_jwe_init(jwe_t **jwe)
Definition: jwe.c:464
_r_json_set_str_value
int _r_json_set_str_value(json_t *j_json, const char *key, const char *str_value)
Definition: misc.c:28
r_jwt_add_enc_key_symmetric
int r_jwt_add_enc_key_symmetric(jwt_t *jwt, const unsigned char *key, size_t key_len)
Definition: jwt.c:759
r_jwt_decrypt_verify_signature_nested
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:1235
jwe_t::key_len
size_t key_len
Definition: rhonabwy.h:174
r_jwe_get_iv
const unsigned char * r_jwe_get_iv(jwe_t *jwe, size_t *iv_len)
Definition: jwe.c:690
r_jwe_encrypt_payload
int r_jwe_encrypt_payload(jwe_t *jwe)
Definition: jwe.c:1196
R_JWA_ALG_EDDSA
@ R_JWA_ALG_EDDSA
Definition: rhonabwy.h:117
_r_json_get_full_json_t
json_t * _r_json_get_full_json_t(json_t *j_json)
Definition: misc.c:109
r_jws_copy
jws_t * r_jws_copy(jws_t *jws)
Definition: jws.c:652
r_jwe_parsen
int r_jwe_parsen(jwe_t *jwe, const char *jwe_str, size_t jwe_str_len, int x5u_flags)
Definition: jwe.c:1739
r_jwe_get_jwks_privkey
jwks_t * r_jwe_get_jwks_privkey(jwe_t *jwe)
Definition: jwe.c:1180
jwt_t::jwks_privkey_sign
jwks_t * jwks_privkey_sign
Definition: rhonabwy.h:190
r_jwt_get_full_header_json_t
json_t * r_jwt_get_full_header_json_t(jwt_t *jwt)
Definition: jwt.c:168
r_jwks_export_to_pem_der
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:220
R_JWA_ALG_PS384
@ R_JWA_ALG_PS384
Definition: rhonabwy.h:119
r_jwk_import_from_gnutls_privkey
int r_jwk_import_from_gnutls_privkey(jwk_t *jwk, gnutls_privkey_t key)
Definition: jwk.c:764
jwt_t::j_header
json_t * j_header
Definition: rhonabwy.h:183
R_JWA_ALG_PBES2_H256
@ R_JWA_ALG_PBES2_H256
Definition: rhonabwy.h:135
r_jws_parsen
int r_jws_parsen(jws_t *jws, const char *jws_str, size_t jws_str_len, int x5u_flags)
Definition: jws.c:1109
R_JWA_ALG_PBES2_H512
@ R_JWA_ALG_PBES2_H512
Definition: rhonabwy.h:137
r_jwt_set_full_claims_json_t
int r_jwt_set_full_claims_json_t(jwt_t *jwt, json_t *j_claim)
Definition: jwt.c:243
R_JWA_ALG_ECDH_ES_A128KW
@ R_JWA_ALG_ECDH_ES_A128KW
Definition: rhonabwy.h:129
R_JWA_ALG_RSA1_5
@ R_JWA_ALG_RSA1_5
Definition: rhonabwy.h:121
r_jwt_get_header_json_t_value
json_t * r_jwt_get_header_json_t_value(jwt_t *jwt, const char *key)
Definition: jwt.c:161
r_jws_get_header_int_value
int r_jws_get_header_int_value(jws_t *jws, const char *key)
Definition: jws.c:832
R_JWA_ALG_ECDH_ES_A192KW
@ R_JWA_ALG_ECDH_ES_A192KW
Definition: rhonabwy.h:130
r_str_to_jwa_alg
jwa_alg r_str_to_jwa_alg(const char *alg)
Definition: misc.c:116
r_jws_get_jwks_pubkey
jwks_t * r_jws_get_jwks_pubkey(jws_t *jws)
Definition: jws.c:1101
r_jwt_get_full_claims_str
char * r_jwt_get_full_claims_str(jwt_t *jwt)
Definition: jwt.c:235
r_jwks_empty
int r_jwks_empty(jwks_t *jwks)
Definition: jwks.c:143
r_library_info_json_t
json_t * r_library_info_json_t()
Definition: misc.c:329
_r_json_set_int_value
int _r_json_set_int_value(json_t *j_json, const char *key, int i_value)
Definition: misc.c:49
r_jwt_add_enc_keys_json_t
int r_jwt_add_enc_keys_json_t(jwt_t *jwt, json_t *privkey, json_t *pubkey)
Definition: jwt.c:642
r_jwt_get_claim_int_value
int r_jwt_get_claim_int_value(jwt_t *jwt, const char *key)
Definition: jwt.c:214
r_jwe_decrypt
int r_jwe_decrypt(jwe_t *jwe, jwk_t *jwk_privkey, int x5u_flags)
Definition: jwe.c:1855
r_jwe_decrypt_payload
int r_jwe_decrypt_payload(jwe_t *jwe)
Definition: jwe.c:1344
jwk_t
json_t jwk_t
Definition: rhonabwy.h:102
r_jwt_set_claim_str_value
int r_jwt_set_claim_str_value(jwt_t *jwt, const char *key, const char *str_value)
Definition: jwt.c:183
r_jwa_alg_to_str
const char * r_jwa_alg_to_str(jwa_alg alg)
Definition: misc.c:184
r_jwk_export_to_json_t
json_t * r_jwk_export_to_json_t(jwk_t *jwk)
Definition: jwk.c:1458
r_jws_add_keys
int r_jws_add_keys(jws_t *jws, jwk_t *jwk_privkey, jwk_t *jwk_pubkey)
Definition: jws.c:853
R_JWA_ALG_ECDH_ES_A256KW
@ R_JWA_ALG_ECDH_ES_A256KW
Definition: rhonabwy.h:131
r_jwk_generate_key_pair
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:289
r_jwt_add_enc_keys_gnutls
int r_jwt_add_enc_keys_gnutls(jwt_t *jwt, gnutls_privkey_t privkey, gnutls_pubkey_t pubkey)
Definition: jwt.c:720
r_jwt_get_type
int r_jwt_get_type(jwt_t *jwt)
Definition: jwt.c:1148
r_jwks_set_at
int r_jwks_set_at(jwks_t *jwks, size_t index, jwk_t *jwk)
Definition: jwks.c:117
_r_json_get_int_value
int _r_json_get_int_value(json_t *j_json, const char *key)
Definition: misc.c:93
r_jwe_add_keys
int r_jwe_add_keys(jwe_t *jwe, jwk_t *jwk_privkey, jwk_t *jwk_pubkey)
Definition: jwe.c:940
r_jwe_add_keys_json_str
int r_jwe_add_keys_json_str(jwe_t *jwe, const char *privkey, const char *pubkey)
Definition: jwe.c:999
r_jws_add_keys_json_t
int r_jws_add_keys_json_t(jws_t *jws, json_t *privkey, json_t *pubkey)
Definition: jws.c:951
R_JWA_ALG_HS256
@ R_JWA_ALG_HS256
Definition: rhonabwy.h:108
r_jwt_set_claim_json_t_value
int r_jwt_set_claim_json_t_value(jwt_t *jwt, const char *key, json_t *j_value)
Definition: jwt.c:199
jwt_t::jws
jws_t * jws
Definition: rhonabwy.h:185
R_JWA_ALG_A256GCMKW
@ R_JWA_ALG_A256GCMKW
Definition: rhonabwy.h:134
r_jwk_import_from_gnutls_x509_crt
int r_jwk_import_from_gnutls_x509_crt(jwk_t *jwk, gnutls_x509_crt_t crt)
Definition: jwk.c:1337
r_jwk_set_property_str
int r_jwk_set_property_str(jwk_t *jwk, const char *key, const char *value)
Definition: jwk.c:2236
r_jws_set_alg
int r_jws_set_alg(jws_t *jws, jwa_alg alg)
Definition: jws.c:714
r_jwks_size
size_t r_jwks_size(jwks_t *jwks)
Definition: jwks.c:67
r_jwe_free
void r_jwe_free(jwe_t *jwe)
Definition: jwe.c:512
r_jwk_delete_property_str
int r_jwk_delete_property_str(jwk_t *jwk, const char *key)
Definition: jwk.c:2291
jwt_t::jwks_pubkey_sign
jwks_t * jwks_pubkey_sign
Definition: rhonabwy.h:191
r_jwt_append_claims_json_t
int r_jwt_append_claims_json_t(jwt_t *jwt, json_t *j_claim)
Definition: jwt.c:270
r_jwt_add_enc_keys_json_str
int r_jwt_add_enc_keys_json_str(jwt_t *jwt, const char *privkey, const char *pubkey)
Definition: jwt.c:603
r_jwks_copy
jwks_t * r_jwks_copy(jwks_t *jwks)
Definition: jwks.c:96
r_jws_serialize
char * r_jws_serialize(jws_t *jws, jwk_t *jwk_privkey, int x5u_flags)
Definition: jws.c:1284
r_jwe_set_header_str_value
int r_jwe_set_header_str_value(jwe_t *jwe, const char *key, const char *str_value)
Definition: jwe.c:869
r_jwks_init
int r_jwks_init(jwks_t **jwks)
Definition: jwks.c:29
R_JWA_ALG_ES512
@ R_JWA_ALG_ES512
Definition: rhonabwy.h:116
r_jwt_add_sign_keys
int r_jwt_add_sign_keys(jwt_t *jwt, jwk_t *privkey, jwk_t *pubkey)
Definition: jwt.c:288
r_jws_set_header_str_value
int r_jws_set_header_str_value(jws_t *jws, const char *key, const char *str_value)
Definition: jws.c:782
r_jwt_add_sign_jwks
int r_jwt_add_sign_jwks(jwt_t *jwt, jwks_t *jwks_privkey, jwks_t *jwks_pubkey)
Definition: jwt.c:314
r_jwt_get_header_str_value
const char * r_jwt_get_header_str_value(jwt_t *jwt, const char *key)
Definition: jwt.c:147
jwt_t::jwks_pubkey_enc
jwks_t * jwks_pubkey_enc
Definition: rhonabwy.h:193
r_jwe_get_payload
const unsigned char * r_jwe_get_payload(jwe_t *jwe, size_t *payload_len)
Definition: jwe.c:588
jws_t::j_header
json_t * j_header
Definition: rhonabwy.h:154
R_JWA_ALG_A128GCMKW
@ R_JWA_ALG_A128GCMKW
Definition: rhonabwy.h:132
r_jwks_import_from_uri
int r_jwks_import_from_uri(jwks_t *jwks, const char *uri, int flags)
Definition: jwks.c:299
r_jwks_export_to_json_str
char * r_jwks_export_to_json_str(jwks_t *jwks, int pretty)
Definition: jwks.c:160
jwt_t::enc_alg
jwa_alg enc_alg
Definition: rhonabwy.h:188
r_jwt_serialize_signed
char * r_jwt_serialize_signed(jwt_t *jwt, jwk_t *privkey, int x5u_flags)
Definition: jwt.c:860
jwa_alg
jwa_alg
Definition: rhonabwy.h:105
R_JWA_ENC_A128CBC
@ R_JWA_ENC_A128CBC
Definition: rhonabwy.h:142
r_jwe_get_header_str_value
const char * r_jwe_get_header_str_value(jwe_t *jwe, const char *key)
Definition: jwe.c:912
R_JWA_ALG_A256KW
@ R_JWA_ALG_A256KW
Definition: rhonabwy.h:126
r_jwk_init
int r_jwk_init(jwk_t **jwk)
Definition: jwk.c:31
r_jwt_add_enc_keys
int r_jwt_add_enc_keys(jwt_t *jwt, jwk_t *privkey, jwk_t *pubkey)
Definition: jwt.c:544
jwe_t::j_header
json_t * j_header
Definition: rhonabwy.h:168
r_jwt_get_sign_jwks_pubkey
jwks_t * r_jwt_get_sign_jwks_pubkey(jwt_t *jwt)
Definition: jwt.c:536
_r_json_set_json_t_value
int _r_json_set_json_t_value(json_t *j_json, const char *key, json_t *j_value)
Definition: misc.c:65
R_JWA_ALG_ECDH_ES
@ R_JWA_ALG_ECDH_ES
Definition: rhonabwy.h:128
jwe_t::key
unsigned char * key
Definition: rhonabwy.h:173
jws_t::jwks_pubkey
jwks_t * jwks_pubkey
Definition: rhonabwy.h:157
r_jws_set_payload
int r_jws_set_payload(jws_t *jws, const unsigned char *payload, size_t payload_len)
Definition: jws.c:679
r_jwk_import_from_json_str
int r_jwk_import_from_json_str(jwk_t *jwk, const char *input)
Definition: jwk.c:631
r_jwt_validate_claims
int r_jwt_validate_claims(jwt_t *jwt,...)
Definition: jwt.c:1508
jws_t::jwks_privkey
jwks_t * jwks_privkey
Definition: rhonabwy.h:156
r_jwk_delete_property_array_at
int r_jwk_delete_property_array_at(jwk_t *jwk, const char *key, size_t index)
Definition: jwk.c:2304
r_jwt_parse
int r_jwt_parse(jwt_t *jwt, const char *token, int x5u_flags)
Definition: jwt.c:1144
r_jwk_free
void r_jwk_free(jwk_t *jwk)
Definition: jwk.c:42
r_jwt_add_enc_jwks
int r_jwt_add_enc_jwks(jwt_t *jwt, jwks_t *jwks_privkey, jwks_t *jwks_pubkey)
Definition: jwt.c:570
jws_t::payload_b64url
unsigned char * payload_b64url
Definition: rhonabwy.h:152
r_jws_get_jwks_privkey
jwks_t * r_jws_get_jwks_privkey(jws_t *jws)
Definition: jws.c:1093
r_jwt_set_header_json_t_value
int r_jwt_set_header_json_t_value(jwt_t *jwt, const char *key, json_t *j_value)
Definition: jwt.c:139
jwe_t::auth_tag_b64url
unsigned char * auth_tag_b64url
Definition: rhonabwy.h:167
r_jws_set_header_int_value
int r_jws_set_header_int_value(jws_t *jws, const char *key, int i_value)
Definition: jws.c:796
R_JWA_ALG_RS256
@ R_JWA_ALG_RS256
Definition: rhonabwy.h:111
r_jwk_append_property_array
int r_jwk_append_property_array(jwk_t *jwk, const char *key, const char *value)
Definition: jwk.c:2273
r_jwt_get_sign_jwks_privkey
jwks_t * r_jwt_get_sign_jwks_privkey(jwt_t *jwt)
Definition: jwt.c:528
r_jws_get_header_json_t_value
json_t * r_jws_get_header_json_t_value(jws_t *jws, const char *key)
Definition: jws.c:839
r_jws_get_alg
jwa_alg r_jws_get_alg(jws_t *jws)
Definition: jws.c:774
jwe_t::iv
unsigned char * iv
Definition: rhonabwy.h:175
r_jwk_import_from_gnutls_pubkey
int r_jwk_import_from_gnutls_pubkey(jwk_t *jwk, gnutls_pubkey_t pub)
Definition: jwk.c:1132
jwt_t::jwe
jwe_t * jwe
Definition: rhonabwy.h:186
R_JWA_ALG_RS384
@ R_JWA_ALG_RS384
Definition: rhonabwy.h:112
R_JWA_ALG_RSA_OAEP
@ R_JWA_ALG_RSA_OAEP
Definition: rhonabwy.h:122
r_jwt_add_sign_keys_pem_der
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:425
R_JWA_ALG_RSA_OAEP_256
@ R_JWA_ALG_RSA_OAEP_256
Definition: rhonabwy.h:123
R_JWA_ALG_A192GCMKW
@ R_JWA_ALG_A192GCMKW
Definition: rhonabwy.h:133
r_jwe_add_jwks
int r_jwe_add_jwks(jwe_t *jwe, jwks_t *jwks_privkey, jwks_t *jwks_pubkey)
Definition: jwe.c:966
r_jwe_get_header_json_t_value
json_t * r_jwe_get_header_json_t_value(jwe_t *jwe, const char *key)
Definition: jwe.c:926
jwe_t
Definition: rhonabwy.h:162
r_jws_add_key_symmetric
int r_jws_add_key_symmetric(jws_t *jws, const unsigned char *key, size_t key_len)
Definition: jws.c:1068
R_JWA_ALG_HS384
@ R_JWA_ALG_HS384
Definition: rhonabwy.h:109
r_jwk_export_to_gnutls_crt
gnutls_x509_crt_t r_jwk_export_to_gnutls_crt(jwk_t *jwk, int x5u_flags)
Definition: jwk.c:2048
r_jwt_set_full_claims_json_str
int r_jwt_set_full_claims_json_str(jwt_t *jwt, const char *str_claims)
Definition: jwt.c:253
r_jws_get_header_str_value
const char * r_jws_get_header_str_value(jws_t *jws, const char *key)
Definition: jws.c:825
jws_t::payload_len
size_t payload_len
Definition: rhonabwy.h:159
jws_t::payload
unsigned char * payload
Definition: rhonabwy.h:158
r_jwe_set_alg
int r_jwe_set_alg(jwe_t *jwe, jwa_alg alg)
Definition: jwe.c:745
R_JWA_ALG_ES384
@ R_JWA_ALG_ES384
Definition: rhonabwy.h:115
R_JWA_ENC_A256GCM
@ R_JWA_ENC_A256GCM
Definition: rhonabwy.h:147
r_jwe_add_keys_pem_der
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:1077
r_jwk_export_to_symmetric_key
int r_jwk_export_to_symmetric_key(jwk_t *jwk, unsigned char *key, size_t *key_len)
Definition: jwk.c:2183
r_jwt_init
int r_jwt_init(jwt_t **jwt)
Definition: jwt.c:28
r_jwk_export_to_gnutls_privkey
gnutls_privkey_t r_jwk_export_to_gnutls_privkey(jwk_t *jwk, int x5u_flags)
Definition: jwk.c:1466
jws_t::alg
jwa_alg alg
Definition: rhonabwy.h:155
r_free
void r_free(void *data)
Definition: misc.c:379
r_jws_get_payload
const unsigned char * r_jws_get_payload(jws_t *jws, size_t *payload_len)
Definition: jws.c:704
r_jwk_export_to_gnutls_pubkey
gnutls_pubkey_t r_jwk_export_to_gnutls_pubkey(jwk_t *jwk, int x5u_flags)
Definition: jwk.c:1778
r_jwks_get_at
jwk_t * r_jwks_get_at(jwks_t *jwks, size_t index)
Definition: jwks.c:75
r_jwe_get_cypher_key
const unsigned char * r_jwe_get_cypher_key(jwe_t *jwe, size_t *key_len)
Definition: jwe.c:625
jwe_t::iv_b64url
unsigned char * iv_b64url
Definition: rhonabwy.h:165
r_jwt_serialize_nested
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:943
r_jwe_get_full_header_json_t
json_t * r_jwe_get_full_header_json_t(jwe_t *jwe)
Definition: jwe.c:933
r_jwe_set_cypher_key
int r_jwe_set_cypher_key(jwe_t *jwe, const unsigned char *key, size_t key_len)
Definition: jwe.c:598
r_jwe_add_keys_json_t
int r_jwe_add_keys_json_t(jwe_t *jwe, json_t *privkey, json_t *pubkey)
Definition: jwe.c:1038
r_jwe_get_alg
jwa_alg r_jwe_get_alg(jwe_t *jwe)
Definition: jwe.c:817
jwe_t::header_b64url
unsigned char * header_b64url
Definition: rhonabwy.h:163
_r_json_get_json_t_value
json_t * _r_json_get_json_t_value(json_t *j_json, const char *key)
Definition: misc.c:100
r_jwk_is_valid
int r_jwk_is_valid(jwk_t *jwk)
Definition: jwk.c:48
r_jws_init
int r_jws_init(jws_t **jws)
Definition: jws.c:598
r_jwe_get_header_int_value
int r_jwe_get_header_int_value(jwe_t *jwe, const char *key)
Definition: jwe.c:919
r_jwt_get_claim_json_t_value
json_t * r_jwt_get_claim_json_t_value(jwt_t *jwt, const char *key)
Definition: jwt.c:221
r_jwk_import_from_json_t
int r_jwk_import_from_json_t(jwk_t *jwk, json_t *j_input)
Definition: jwk.c:648