Rhonabwy: include/rhonabwy.h Source File

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 #include <nettle/version.h>
38
39 #define RHN_BEGIN_CERT_TAG "-----BEGIN CERTIFICATE-----"
40
47 #define RHN_OK 0
48 #define RHN_ERROR 1
49 #define RHN_ERROR_MEMORY 2
50 #define RHN_ERROR_PARAM 3
51 #define RHN_ERROR_UNSUPPORTED 4
52 #define RHN_ERROR_INVALID 5
53
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_ECDSA 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_NOP 0
82 #define R_JWT_CLAIM_ISS 1
83 #define R_JWT_CLAIM_SUB 2
84 #define R_JWT_CLAIM_AUD 3
85 #define R_JWT_CLAIM_EXP 4
86 #define R_JWT_CLAIM_NBF 5
87 #define R_JWT_CLAIM_IAT 6
88 #define R_JWT_CLAIM_JTI 7
89 #define R_JWT_CLAIM_STR 8
90 #define R_JWT_CLAIM_INT 9
91 #define R_JWT_CLAIM_JSN 10
92 #define R_JWT_CLAIM_TYP 11
93 #define R_JWT_CLAIM_CTY 12
94
95 #define R_JWT_CLAIM_NOW -1
96 #define R_JWT_CLAIM_PRESENT -2
97
98 #define R_JWK_THUMB_SHA256 0
99 #define R_JWK_THUMB_SHA384 1
100 #define R_JWK_THUMB_SHA512 2
101
112 typedef json_t jwk_t;
113 typedef json_t jwks_t;
114
115 typedef enum {
116 R_JWA_ALG_UNKNOWN = 0,
117 R_JWA_ALG_NONE = 1,
118 R_JWA_ALG_HS256 = 2,
119 R_JWA_ALG_HS384 = 3,
120 R_JWA_ALG_HS512 = 4,
121 R_JWA_ALG_RS256 = 5,
122 R_JWA_ALG_RS384 = 6,
123 R_JWA_ALG_RS512 = 7,
124 R_JWA_ALG_ES256 = 8,
125 R_JWA_ALG_ES384 = 9,
126 R_JWA_ALG_ES512 = 10,
127 R_JWA_ALG_EDDSA = 11,
128 R_JWA_ALG_PS256 = 12,
129 R_JWA_ALG_PS384 = 13,
130 R_JWA_ALG_PS512 = 14,
131 R_JWA_ALG_RSA1_5 = 15,
132 R_JWA_ALG_RSA_OAEP = 16,
133 R_JWA_ALG_RSA_OAEP_256 = 17,
134 R_JWA_ALG_A128KW = 18,
135 R_JWA_ALG_A192KW = 19,
136 R_JWA_ALG_A256KW = 20,
137 R_JWA_ALG_DIR = 21,
138 R_JWA_ALG_ECDH_ES = 22,
139 R_JWA_ALG_ECDH_ES_A128KW = 23,
140 R_JWA_ALG_ECDH_ES_A192KW = 24,
141 R_JWA_ALG_ECDH_ES_A256KW = 25,
142 R_JWA_ALG_A128GCMKW = 26,
143 R_JWA_ALG_A192GCMKW = 27,
144 R_JWA_ALG_A256GCMKW = 28,
145 R_JWA_ALG_PBES2_H256 = 29,
146 R_JWA_ALG_PBES2_H384 = 30,
147 R_JWA_ALG_PBES2_H512 = 31,
148 R_JWA_ALG_ES256K = 32
149 } jwa_alg;
150
151 typedef enum {
152 R_JWA_ENC_UNKNOWN = 0,
153 R_JWA_ENC_A128CBC = 1,
154 R_JWA_ENC_A192CBC = 2,
155 R_JWA_ENC_A256CBC = 3,
156 R_JWA_ENC_A128GCM = 4,
157 R_JWA_ENC_A192GCM = 5,
158 R_JWA_ENC_A256GCM = 6
159 } jwa_enc;
160
161 typedef struct {
162 unsigned char * header_b64url;
163 unsigned char * payload_b64url;
164 unsigned char * signature_b64url;
165 json_t * j_header;
166 jwa_alg alg;
167 jwks_t * jwks_privkey;
168 jwks_t * jwks_pubkey;
169 unsigned char * payload;
170 size_t payload_len;
171 } jws_t;
172
173 typedef struct {
174 unsigned char * header_b64url;
175 unsigned char * encrypted_key_b64url;
176 unsigned char * iv_b64url;
177 unsigned char * ciphertext_b64url;
178 unsigned char * auth_tag_b64url;
179 json_t * j_header;
180 jwa_alg alg;
181 jwa_enc enc;
182 jwks_t * jwks_privkey;
183 jwks_t * jwks_pubkey;
184 unsigned char * key;
185 size_t key_len;
186 unsigned char * iv;
187 size_t iv_len;
188 unsigned char * payload;
189 size_t payload_len;
190 } jwe_t;
191
192 typedef struct {
193 int type;
194 json_t * j_header;
195 json_t * j_claims;
196 jws_t * jws;
197 jwe_t * jwe;
198 jwa_alg sign_alg;
199 jwa_alg enc_alg;
200 jwa_enc enc;
201 jwks_t * jwks_privkey_sign;
202 jwks_t * jwks_pubkey_sign;
203 jwks_t * jwks_privkey_enc;
204 jwks_t * jwks_pubkey_enc;
205 } jwt_t;
206
224 int r_global_init();
225
229 void r_global_close();
230
238 json_t * r_library_info_json_t();
239
247 char * r_library_info_json_str();
248
254 void r_free(void * data);
255
261 int r_jwk_init(jwk_t ** jwk);
262
267 void r_jwk_free(jwk_t * jwk);
268
274 int r_jwks_init(jwks_t ** jwks);
275
280 void r_jwks_free(jwks_t * jwks);
281
287 int r_jws_init(jws_t ** jws);
288
293 void r_jws_free(jws_t * jws);
294
300 int r_jwe_init(jwe_t ** jwe);
301
306 void r_jwe_free(jwe_t * jwe);
307
313 int r_jwt_init(jwt_t ** jwt);
314
319 void r_jwt_free(jwt_t * jwt);
320
326 jwa_alg r_str_to_jwa_alg(const char * alg);
327
334 const char * r_jwa_alg_to_str(jwa_alg alg);
335
341 jwa_enc r_str_to_jwa_enc(const char * enc);
342
349 const char * r_jwa_enc_to_str(jwa_enc enc);
350
386 int r_jwk_key_type(jwk_t * jwk, unsigned int * bits, int x5u_flags);
387
394 int r_jwk_is_valid(jwk_t * jwk);
395
408 int r_jwk_is_valid_x5u(jwk_t * jwk, int x5u_flags);
409
421 int r_jwk_generate_key_pair(jwk_t * jwk_privkey, jwk_t * jwk_pubkey, int type, unsigned int bits, const char * kid);
422
439 const char * r_jwk_get_property_str(jwk_t * jwk, const char * key);
440
448 const char * r_jwk_get_property_array(jwk_t * jwk, const char * key, size_t index);
449
456 int r_jwk_get_property_array_size(jwk_t * jwk, const char * key);
457
466 int r_jwk_set_property_str(jwk_t * jwk, const char * key, const char * value);
467
477 int r_jwk_set_property_array(jwk_t * jwk, const char * key, size_t index, const char * value);
478
487 int r_jwk_append_property_array(jwk_t * jwk, const char * key, const char * value);
488
496 int r_jwk_delete_property_str(jwk_t * jwk, const char * key);
497
506 int r_jwk_delete_property_array_at(jwk_t * jwk, const char * key, size_t index);
507
517 int r_jwk_append_x5c(jwk_t * jwk, int format, const unsigned char * input, size_t input_len);
518
536 int r_jwk_import_from_json_str(jwk_t * jwk, const char * input);
537
545 int r_jwk_import_from_json_t(jwk_t * jwk, json_t * j_input);
546
557 int r_jwk_import_from_pem_der(jwk_t * jwk, int type, int format, const unsigned char * input, size_t input_len);
558
566 int r_jwk_import_from_gnutls_privkey(jwk_t * jwk, gnutls_privkey_t key);
567
575 int r_jwk_import_from_gnutls_pubkey(jwk_t * jwk, gnutls_pubkey_t pub);
576
584 int r_jwk_import_from_gnutls_x509_crt(jwk_t * jwk, gnutls_x509_crt_t crt);
585
597 int r_jwk_import_from_x5u(jwk_t * jwk, int x5u_flags, const char * x5u);
598
607 int r_jwk_import_from_symmetric_key(jwk_t * jwk, const unsigned char * key, size_t key_len);
608
616 int r_jwk_import_from_password(jwk_t * jwk, const char * password);
617
630 int r_jwk_extract_pubkey(jwk_t * jwk_privkey, jwk_t * jwk_pubkey, int x5u_flags);
631
637 jwk_t * r_jwk_copy(jwk_t * jwk);
638
645 int r_jwk_equal(jwk_t * jwk1, jwk_t * jwk2);
646
663 char * r_jwk_export_to_json_str(jwk_t * jwk, int pretty);
664
670 json_t * r_jwk_export_to_json_t(jwk_t * jwk);
671
677 gnutls_privkey_t r_jwk_export_to_gnutls_privkey(jwk_t * jwk);
678
690 gnutls_pubkey_t r_jwk_export_to_gnutls_pubkey(jwk_t * jwk, int x5u_flags);
691
705 gnutls_x509_crt_t r_jwk_export_to_gnutls_crt(jwk_t * jwk, int x5u_flags);
706
722 int r_jwk_export_to_pem_der(jwk_t * jwk, int format, unsigned char * output, size_t * output_len, int x5u_flags);
723
732 int r_jwk_export_to_symmetric_key(jwk_t * jwk, unsigned char * key, size_t * key_len);
733
750 char * r_jwk_thumbprint(jwk_t * jwk, int hash, int x5u_flags);
751
764 int r_jwk_validate_x5c_chain(jwk_t * jwk, int x5u_flags);
765
783 int r_jwks_is_valid(jwks_t * jwks);
784
794 int r_jwks_import_from_str(jwks_t * jwks, const char * input);
795
805 int r_jwks_import_from_json_t(jwks_t * jwks, json_t * j_input);
806
820 int r_jwks_import_from_uri(jwks_t * jwks, const char * uri, int x5u_flags);
821
827 jwks_t * r_jwks_copy(jwks_t * jwks);
828
834 size_t r_jwks_size(jwks_t * jwks);
835
843 jwk_t * r_jwks_get_at(jwks_t * jwks, size_t index);
844
852 jwk_t * r_jwks_get_by_kid(jwks_t * jwks, const char * kid);
853
860 int r_jwks_append_jwk(jwks_t * jwks, jwk_t * jwk);
861
869 int r_jwks_set_at(jwks_t * jwks, size_t index, jwk_t * jwk);
870
877 int r_jwks_remove_at(jwks_t * jwks, size_t index);
878
884 int r_jwks_empty(jwks_t * jwks);
885
893 int r_jwks_equal(jwks_t * jwks1, jwks_t * jwks2);
894
901 char * r_jwks_export_to_json_str(jwks_t * jwks, int pretty);
902
908 json_t * r_jwks_export_to_json_t(jwks_t * jwks);
909
917 gnutls_privkey_t * r_jwks_export_to_gnutls_privkey(jwks_t * jwks, size_t * len);
918
931 gnutls_pubkey_t * r_jwks_export_to_gnutls_pubkey(jwks_t * jwks, size_t * len, int x5u_flags);
932
948 int r_jwks_export_to_pem_der(jwks_t * jwks, int format, unsigned char * output, size_t * output_len, int x5u_flags);
949
965 jws_t * r_jws_copy(jws_t * jws);
966
974 int r_jws_set_payload(jws_t * jws, const unsigned char * payload, size_t payload_len);
975
982 const unsigned char * r_jws_get_payload(jws_t * jws, size_t * payload_len);
983
990 int r_jws_set_alg(jws_t * jws, jwa_alg alg);
991
997 jwa_alg r_jws_get_alg(jws_t * jws);
998
1006 int r_jws_set_header_str_value(jws_t * jws, const char * key, const char * str_value);
1007
1015 int r_jws_set_header_int_value(jws_t * jws, const char * key, int i_value);
1016
1024 int r_jws_set_header_json_t_value(jws_t * jws, const char * key, json_t * j_value);
1025
1032 const char * r_jws_get_header_str_value(jws_t * jws, const char * key);
1033
1040 int r_jws_get_header_int_value(jws_t * jws, const char * key);
1041
1048 json_t * r_jws_get_header_json_t_value(jws_t * jws, const char * key);
1049
1055 json_t * r_jws_get_full_header_json_t(jws_t * jws);
1056
1064 int r_jws_add_keys(jws_t * jws, jwk_t * jwk_privkey, jwk_t * jwk_pubkey);
1065
1073 int r_jws_add_jwks(jws_t * jws, jwks_t * jwks_privkey, jwks_t * jwks_pubkey);
1074
1083 int r_jws_add_keys_json_str(jws_t * jws, const char * privkey, const char * pubkey);
1084
1093 int r_jws_add_keys_json_t(jws_t * jws, json_t * privkey, json_t * pubkey);
1094
1106 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);
1107
1116 int r_jws_add_keys_gnutls(jws_t * jws, gnutls_privkey_t privkey, gnutls_pubkey_t pubkey);
1117
1125 int r_jws_add_key_symmetric(jws_t * jws, const unsigned char * key, size_t key_len);
1126
1132 jwks_t * r_jws_get_jwks_privkey(jws_t * jws);
1133
1139 jwks_t * r_jws_get_jwks_pubkey(jws_t * jws);
1140
1153 int r_jws_parse(jws_t * jws, const char * jws_str, int x5u_flags);
1154
1168 int r_jws_parsen(jws_t * jws, const char * jws_str, size_t jws_str_len, int x5u_flags);
1169
1185 int r_jws_verify_signature(jws_t * jws, jwk_t * jwk_pubkey, int x5u_flags);
1186
1200 char * r_jws_serialize(jws_t * jws, jwk_t * jwk_privkey, int x5u_flags);
1201
1217 jwe_t * r_jwe_copy(jwe_t * jwe);
1218
1226 int r_jwe_set_payload(jwe_t * jwe, const unsigned char * payload, size_t payload_len);
1227
1234 const unsigned char * r_jwe_get_payload(jwe_t * jwe, size_t * payload_len);
1235
1242 int r_jwe_set_alg(jwe_t * jwe, jwa_alg alg);
1243
1249 jwa_alg r_jwe_get_alg(jwe_t * jwe);
1250
1257 int r_jwe_set_enc(jwe_t * jwe, jwa_enc enc);
1258
1264 jwa_enc r_jwe_get_enc(jwe_t * jwe);
1265
1273 int r_jwe_set_header_str_value(jwe_t * jwe, const char * key, const char * str_value);
1274
1282 int r_jwe_set_header_int_value(jwe_t * jwe, const char * key, int i_value);
1283
1291 int r_jwe_set_header_json_t_value(jwe_t * jwe, const char * key, json_t * j_value);
1292
1299 const char * r_jwe_get_header_str_value(jwe_t * jwe, const char * key);
1300
1307 int r_jwe_get_header_int_value(jwe_t * jwe, const char * key);
1308
1315 json_t * r_jwe_get_header_json_t_value(jwe_t * jwe, const char * key);
1316
1322 json_t * r_jwe_get_full_header_json_t(jwe_t * jwe);
1323
1331 int r_jwe_add_keys(jwe_t * jwe, jwk_t * jwk_privkey, jwk_t * jwk_pubkey);
1332
1340 int r_jwe_add_jwks(jwe_t * jwe, jwks_t * jwks_privkey, jwks_t * jwks_pubkey);
1341
1350 int r_jwe_add_keys_json_str(jwe_t * jwe, const char * privkey, const char * pubkey);
1351
1360 int r_jwe_add_keys_json_t(jwe_t * jwe, json_t * privkey, json_t * pubkey);
1361
1373 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);
1374
1383 int r_jwe_add_keys_gnutls(jwe_t * jwe, gnutls_privkey_t privkey, gnutls_pubkey_t pubkey);
1384
1392 int r_jwe_add_key_symmetric(jwe_t * jwe, const unsigned char * key, size_t key_len);
1393
1399 jwks_t * r_jwe_get_jwks_privkey(jwe_t * jwe);
1400
1406 jwks_t * r_jwe_get_jwks_pubkey(jwe_t * jwe);
1407
1415 int r_jwe_set_cypher_key(jwe_t * jwe, const unsigned char * key, size_t key_len);
1416
1423 const unsigned char * r_jwe_get_cypher_key(jwe_t * jwe, size_t * key_len);
1424
1430 int r_jwe_generate_cypher_key(jwe_t * jwe);
1431
1439 int r_jwe_set_iv(jwe_t * jwe, const unsigned char * iv, size_t iv_len);
1440
1447 const unsigned char * r_jwe_get_iv(jwe_t * jwe, size_t * iv_len);
1448
1454 int r_jwe_generate_iv(jwe_t * jwe);
1455
1461 int r_jwe_encrypt_payload(jwe_t * jwe);
1462
1468 int r_jwe_decrypt_payload(jwe_t * jwe);
1469
1482 int r_jwe_encrypt_key(jwe_t * jwe, jwk_t * jwk_pubkey, int x5u_flags);
1483
1496 int r_jwe_decrypt_key(jwe_t * jwe, jwk_t * jwk_privkey, int x5u_flags);
1497
1510 int r_jwe_parse(jwe_t * jwe, const char * jwe_str, int x5u_flags);
1511
1525 int r_jwe_parsen(jwe_t * jwe, const char * jwe_str, size_t jwe_str_len, int x5u_flags);
1526
1540 int r_jwe_decrypt(jwe_t * jwe, jwk_t * jwk_privkey, int x5u_flags);
1541
1555 char * r_jwe_serialize(jwe_t * jwe, jwk_t * jwk_pubkey, int x5u_flags);
1556
1572 jwt_t * r_jwt_copy(jwt_t * jwt);
1573
1581 int r_jwt_set_header_str_value(jwt_t * jwt, const char * key, const char * str_value);
1582
1590 int r_jwt_set_header_int_value(jwt_t * jwt, const char * key, int i_value);
1591
1599 int r_jwt_set_header_json_t_value(jwt_t * jwt, const char * key, json_t * j_value);
1600
1607 const char * r_jwt_get_header_str_value(jwt_t * jwt, const char * key);
1608
1615 int r_jwt_get_header_int_value(jwt_t * jwt, const char * key);
1616
1623 json_t * r_jwt_get_header_json_t_value(jwt_t * jwt, const char * key);
1624
1630 json_t * r_jwt_get_full_header_json_t(jwt_t * jwt);
1631
1637 char * r_jwt_get_full_header_str(jwt_t * jwt);
1638
1646 int r_jwt_set_claim_str_value(jwt_t * jwt, const char * key, const char * str_value);
1647
1655 int r_jwt_set_claim_int_value(jwt_t * jwt, const char * key, int i_value);
1656
1664 int r_jwt_set_claim_json_t_value(jwt_t * jwt, const char * key, json_t * j_value);
1665
1672 const char * r_jwt_get_claim_str_value(jwt_t * jwt, const char * key);
1673
1680 int r_jwt_get_claim_int_value(jwt_t * jwt, const char * key);
1681
1688 json_t * r_jwt_get_claim_json_t_value(jwt_t * jwt, const char * key);
1689
1695 json_t * r_jwt_get_full_claims_json_t(jwt_t * jwt);
1696
1702 char * r_jwt_get_full_claims_str(jwt_t * jwt);
1703
1711 int r_jwt_set_full_claims_json_t(jwt_t * jwt, json_t * j_claim);
1712
1720 int r_jwt_set_full_claims_json_str(jwt_t * jwt, const char * str_claims);
1721
1729 int r_jwt_append_claims_json_t(jwt_t * jwt, json_t * j_claim);
1730
1738 int r_jwt_add_sign_keys(jwt_t * jwt, jwk_t * privkey, jwk_t * pubkey);
1739
1747 int r_jwt_add_sign_jwks(jwt_t * jwt, jwks_t * jwks_privkey, jwks_t * jwks_pubkey);
1748
1757 int r_jwt_add_sign_keys_json_str(jwt_t * jwt, const char * privkey, const char * pubkey);
1758
1767 int r_jwt_add_sign_keys_json_t(jwt_t * jwt, json_t * privkey, json_t * pubkey);
1768
1780 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);
1781
1790 int r_jwt_add_sign_keys_gnutls(jwt_t * jwt, gnutls_privkey_t privkey, gnutls_pubkey_t pubkey);
1791
1799 int r_jwt_add_sign_key_symmetric(jwt_t * jwt, const unsigned char * key, size_t key_len);
1800
1806 jwks_t * r_jwt_get_sign_jwks_privkey(jwt_t * jwt);
1807
1813 jwks_t * r_jwt_get_sign_jwks_pubkey(jwt_t * jwt);
1814
1822 int r_jwt_add_enc_keys(jwt_t * jwt, jwk_t * privkey, jwk_t * pubkey);
1823
1831 int r_jwt_add_enc_jwks(jwt_t * jwt, jwks_t * jwks_privkey, jwks_t * jwks_pubkey);
1832
1841 int r_jwt_add_enc_keys_json_str(jwt_t * jwt, const char * privkey, const char * pubkey);
1842
1851 int r_jwt_add_enc_keys_json_t(jwt_t * jwt, json_t * privkey, json_t * pubkey);
1852
1864 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);
1865
1874 int r_jwt_add_enc_keys_gnutls(jwt_t * jwt, gnutls_privkey_t privkey, gnutls_pubkey_t pubkey);
1875
1883 int r_jwt_add_enc_key_symmetric(jwt_t * jwt, const unsigned char * key, size_t key_len);
1884
1890 jwks_t * r_jwt_get_enc_jwks_privkey(jwt_t * jwt);
1891
1897 jwks_t * r_jwt_get_enc_jwks_pubkey(jwt_t * jwt);
1898
1905 int r_jwt_set_sign_alg(jwt_t * jwt, jwa_alg alg);
1906
1912 jwa_alg r_jwt_get_sign_alg(jwt_t * jwt);
1913
1920 int r_jwt_set_enc_alg(jwt_t * jwt, jwa_alg alg);
1921
1927 jwa_alg r_jwt_get_enc_alg(jwt_t * jwt);
1928
1935 int r_jwt_set_enc(jwt_t * jwt, jwa_enc enc);
1936
1942 jwa_enc r_jwt_get_enc(jwt_t * jwt);
1943
1956 char * r_jwt_serialize_signed(jwt_t * jwt, jwk_t * privkey, int x5u_flags);
1957
1970 char * r_jwt_serialize_encrypted(jwt_t * jwt, jwk_t * pubkey, int x5u_flags);
1971
1996 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);
1997
2013 int r_jwt_parse(jwt_t * jwt, const char * token, int x5u_flags);
2014
2031 int r_jwt_parsen(jwt_t * jwt, const char * token, size_t token_len, int x5u_flags);
2032
2043 int r_jwt_get_type(jwt_t * jwt);
2044
2060 int r_jwt_verify_signature(jwt_t * jwt, jwk_t * pubkey, int x5u_flags);
2061
2075 int r_jwt_decrypt(jwt_t * jwt, jwk_t * privkey, int x5u_flags);
2076
2099 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);
2100
2115 int r_jwt_decrypt_nested(jwt_t * jwt, jwk_t * decrypt_key, int decrypt_key_x5u_flags);
2116
2130 int r_jwt_verify_signature_nested(jwt_t * jwt, jwk_t * verify_key, int verify_key_x5u_flags);
2131
2158 int r_jwt_validate_claims(jwt_t * jwt, ...);
2159
2164 #ifndef DOXYGEN_SHOULD_SKIP_THIS
2165
2169 int _r_json_set_str_value(json_t * j_json, const char * key, const char * str_value);
2170
2171 int _r_json_set_int_value(json_t * j_json, const char * key, int i_value);
2172
2173 int _r_json_set_json_t_value(json_t * j_json, const char * key, json_t * j_value);
2174
2175 const char * _r_json_get_str_value(json_t * j_json, const char * key);
2176
2177 int _r_json_get_int_value(json_t * j_json, const char * key);
2178
2179 json_t * _r_json_get_json_t_value(json_t * j_json, const char * key);
2180
2181 json_t * _r_json_get_full_json_t(json_t * j_json);
2182
2183 #endif
2184
2185 #ifdef __cplusplus
2186 }
2187 #endif
2188
2189 #endif // __RHONABWY_H_
r_library_info_json_t
json_t * r_library_info_json_t()
Definition: misc.c:408
r_library_info_json_str
char * r_library_info_json_str()
Definition: misc.c:467
r_jwe_free
void r_jwe_free(jwe_t *jwe)
Definition: jwe.c:1930
r_jwa_alg_to_str
const char * r_jwa_alg_to_str(jwa_alg alg)
Definition: misc.c:260
r_global_close
void r_global_close()
Definition: misc.c:51
r_jws_init
int r_jws_init(jws_t **jws)
Definition: jws.c:684
r_str_to_jwa_enc
jwa_enc r_str_to_jwa_enc(const char *enc)
Definition: misc.c:364
r_jws_free
void r_jws_free(jws_t *jws)
Definition: jws.c:725
r_jwk_free
void r_jwk_free(jwk_t *jwk)
Definition: jwk.c:50
r_jwks_free
void r_jwks_free(jwks_t *jwks)
Definition: jwks.c:41
r_jwt_free
void r_jwt_free(jwt_t *jwt)
Definition: jwt.c:84
r_jwks_init
int r_jwks_init(jwks_t **jwks)
Definition: jwks.c:30
r_str_to_jwa_alg
jwa_alg r_str_to_jwa_alg(const char *alg)
Definition: misc.c:188
r_jwe_init
int r_jwe_init(jwe_t **jwe)
Definition: jwe.c:1882
r_free
void r_free(void *data)
Definition: misc.c:477
r_jwa_enc_to_str
const char * r_jwa_enc_to_str(jwa_enc enc)
Definition: misc.c:382
r_jwt_init
int r_jwt_init(jwt_t **jwt)
Definition: jwt.c:28
r_global_init
int r_global_init()
Definition: misc.c:32
r_jwk_init
int r_jwk_init(jwk_t **jwk)
Definition: jwk.c:39
r_jwk_export_to_gnutls_pubkey
gnutls_pubkey_t r_jwk_export_to_gnutls_pubkey(jwk_t *jwk, int x5u_flags)
Definition: jwk.c:2153
r_jwk_export_to_gnutls_privkey
gnutls_privkey_t r_jwk_export_to_gnutls_privkey(jwk_t *jwk)
Definition: jwk.c:1823
r_jwk_thumbprint
char * r_jwk_thumbprint(jwk_t *jwk, int hash, int x5u_flags)
Definition: jwk.c:2756
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:2443
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:2563
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:2507
r_jwk_export_to_json_t
json_t * r_jwk_export_to_json_t(jwk_t *jwk)
Definition: jwk.c:1815
r_jwk_export_to_json_str
char * r_jwk_export_to_json_str(jwk_t *jwk, int pretty)
Definition: jwk.c:1807
r_jwk_validate_x5c_chain
int r_jwk_validate_x5c_chain(jwk_t *jwk, int x5u_flags)
Definition: jwk.c:2850
r_jwk_import_from_password
int r_jwk_import_from_password(jwk_t *jwk, const char *password)
Definition: jwk.c:1791
r_jwk_import_from_json_str
int r_jwk_import_from_json_str(jwk_t *jwk, const char *input)
Definition: jwk.c:845
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:878
r_jwk_import_from_json_t
int r_jwk_import_from_json_t(jwk_t *jwk, json_t *j_input)
Definition: jwk.c:862
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:1705
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:1762
r_jwk_import_from_gnutls_pubkey
int r_jwk_import_from_gnutls_pubkey(jwk_t *jwk, gnutls_pubkey_t pub)
Definition: jwk.c:1442
r_jwk_copy
jwk_t * r_jwk_copy(jwk_t *jwk)
Definition: jwk.c:1795
r_jwk_equal
int r_jwk_equal(jwk_t *jwk1, jwk_t *jwk2)
Definition: jwk.c:1803
r_jwk_extract_pubkey
int r_jwk_extract_pubkey(jwk_t *jwk_privkey, jwk_t *jwk_pubkey, int x5u_flags)
Definition: jwk.c:806
r_jwk_import_from_x5u
int r_jwk_import_from_x5u(jwk_t *jwk, int x5u_flags, const char *x5u)
Definition: jwk.c:1741
r_jwk_import_from_gnutls_privkey
int r_jwk_import_from_gnutls_privkey(jwk_t *jwk, gnutls_privkey_t key)
Definition: jwk.c:995
r_jwe_get_payload
const unsigned char * r_jwe_get_payload(jwe_t *jwe, size_t *payload_len)
Definition: jwe.c:2005
r_jwe_set_iv
int r_jwe_set_iv(jwe_t *jwe, const unsigned char *iv, size_t iv_len)
Definition: jwe.c:2080
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:2330
r_jwe_encrypt_payload
int r_jwe_encrypt_payload(jwe_t *jwe)
Definition: jwe.c:2629
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:2316
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:2510
r_jwe_set_payload
int r_jwe_set_payload(jwe_t *jwe, const unsigned char *payload, size_t payload_len)
Definition: jwe.c:1978
r_jwe_set_enc
int r_jwe_set_enc(jwe_t *jwe, jwa_enc enc)
Definition: jwe.c:2258
r_jwe_decrypt_payload
int r_jwe_decrypt_payload(jwe_t *jwe)
Definition: jwe.c:2790
r_jwe_get_enc
jwa_enc r_jwe_get_enc(jwe_t *jwe)
Definition: jwe.c:2294
r_jwe_parse
int r_jwe_parse(jwe_t *jwe, const char *jwe_str, int x5u_flags)
Definition: jwe.c:3496
r_jwe_set_alg
int r_jwe_set_alg(jwe_t *jwe, jwa_alg alg)
Definition: jwe.c:2178
r_jwe_get_header_int_value
int r_jwe_get_header_int_value(jwe_t *jwe, const char *key)
Definition: jwe.c:2352
r_jwe_get_header_str_value
const char * r_jwe_get_header_str_value(jwe_t *jwe, const char *key)
Definition: jwe.c:2345
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:2549
r_jwe_generate_iv
int r_jwe_generate_iv(jwe_t *jwe)
Definition: jwe.c:2133
r_jwe_generate_cypher_key
int r_jwe_generate_cypher_key(jwe_t *jwe)
Definition: jwe.c:2052
r_jwe_get_iv
const unsigned char * r_jwe_get_iv(jwe_t *jwe, size_t *iv_len)
Definition: jwe.c:2123
r_jwe_add_keys
int r_jwe_add_keys(jwe_t *jwe, jwk_t *jwk_privkey, jwk_t *jwk_pubkey)
Definition: jwe.c:2373
r_jwe_get_jwks_pubkey
jwks_t * r_jwe_get_jwks_pubkey(jwe_t *jwe)
Definition: jwe.c:2621
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:2015
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:2432
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:2471
r_jwe_get_jwks_privkey
jwks_t * r_jwe_get_jwks_privkey(jwe_t *jwe)
Definition: jwe.c:2613
r_jwe_copy
jwe_t * r_jwe_copy(jwe_t *jwe)
Definition: jwe.c:1947
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:3382
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:2588
r_jwe_decrypt
int r_jwe_decrypt(jwe_t *jwe, jwk_t *jwk_privkey, int x5u_flags)
Definition: jwe.c:3500
r_jwe_decrypt_key
int r_jwe_decrypt_key(jwe_t *jwe, jwk_t *jwk_privkey, int x5u_flags)
Definition: jwe.c:3166
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:2359
r_jwe_get_alg
jwa_alg r_jwe_get_alg(jwe_t *jwe)
Definition: jwe.c:2250
r_jwe_encrypt_key
int r_jwe_encrypt_key(jwe_t *jwe, jwk_t *jwk_pubkey, int x5u_flags)
Definition: jwe.c:2948
r_jwe_get_full_header_json_t
json_t * r_jwe_get_full_header_json_t(jwe_t *jwe)
Definition: jwe.c:2366
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:2302
r_jwe_serialize
char * r_jwe_serialize(jwe_t *jwe, jwk_t *jwk_pubkey, int x5u_flags)
Definition: jwe.c:3514
r_jwe_get_cypher_key
const unsigned char * r_jwe_get_cypher_key(jwe_t *jwe, size_t *key_len)
Definition: jwe.c:2042
r_jwe_add_jwks
int r_jwe_add_jwks(jwe_t *jwe, jwks_t *jwks_privkey, jwks_t *jwks_pubkey)
Definition: jwe.c:2399
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:2642
r_jwk_get_property_str
const char * r_jwk_get_property_str(jwk_t *jwk, const char *key)
Definition: jwk.c:2591
r_jwk_delete_property_str
int r_jwk_delete_property_str(jwk_t *jwk, const char *key)
Definition: jwk.c:2684
r_jwk_append_property_array
int r_jwk_append_property_array(jwk_t *jwk, const char *key, const char *value)
Definition: jwk.c:2666
r_jwk_set_property_str
int r_jwk_set_property_str(jwk_t *jwk, const char *key, const char *value)
Definition: jwk.c:2629
r_jwk_append_x5c
int r_jwk_append_x5c(jwk_t *jwk, int format, const unsigned char *input, size_t input_len)
Definition: jwk.c:2710
r_jwk_get_property_array_size
int r_jwk_get_property_array_size(jwk_t *jwk, const char *key)
Definition: jwk.c:2616
r_jwk_get_property_array
const char * r_jwk_get_property_array(jwk_t *jwk, const char *key, size_t index)
Definition: jwk.c:2603
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:2697
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:453
r_jwk_is_valid_x5u
int r_jwk_is_valid_x5u(jwk_t *jwk, int x5u_flags)
Definition: jwk.c:402
r_jwk_key_type
int r_jwk_key_type(jwk_t *jwk, unsigned int *bits, int x5u_flags)
Definition: jwk.c:606
r_jwk_is_valid
int r_jwk_is_valid(jwk_t *jwk)
Definition: jwk.c:56
r_jwks_size
size_t r_jwks_size(jwks_t *jwks)
Definition: jwks.c:68
r_jwks_import_from_str
int r_jwks_import_from_str(jwks_t *jwks, const char *input)
Definition: jwks.c:248
r_jwks_import_from_uri
int r_jwks_import_from_uri(jwks_t *jwks, const char *uri, int x5u_flags)
Definition: jwks.c:300
r_jwks_copy
jwks_t * r_jwks_copy(jwks_t *jwks)
Definition: jwks.c:97
r_jwks_export_to_json_t
json_t * r_jwks_export_to_json_t(jwks_t *jwks)
Definition: jwks.c:169
r_jwks_equal
int r_jwks_equal(jwks_t *jwks1, jwks_t *jwks2)
Definition: jwks.c:157
r_jwks_export_to_gnutls_privkey
gnutls_privkey_t * r_jwks_export_to_gnutls_privkey(jwks_t *jwks, size_t *len)
Definition: jwks.c:177
r_jwks_import_from_json_t
int r_jwks_import_from_json_t(jwks_t *jwks, json_t *j_input)
Definition: jwks.c:271
r_jwks_remove_at
int r_jwks_remove_at(jwks_t *jwks, size_t index)
Definition: jwks.c:131
r_jwks_get_by_kid
jwk_t * r_jwks_get_by_kid(jwks_t *jwks, const char *kid)
Definition: jwks.c:84
r_jwks_is_valid
int r_jwks_is_valid(jwks_t *jwks)
Definition: jwks.c:47
r_jwks_set_at
int r_jwks_set_at(jwks_t *jwks, size_t index, jwk_t *jwk)
Definition: jwks.c:118
r_jwks_append_jwk
int r_jwks_append_jwk(jwks_t *jwks, jwk_t *jwk)
Definition: jwks.c:105
r_jwks_export_to_json_str
char * r_jwks_export_to_json_str(jwks_t *jwks, int pretty)
Definition: jwks.c:161
r_jwks_get_at
jwk_t * r_jwks_get_at(jwks_t *jwks, size_t index)
Definition: jwks.c:76
r_jwks_empty
int r_jwks_empty(jwks_t *jwks)
Definition: jwks.c:144
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:221
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:199
r_jws_verify_signature
int r_jws_verify_signature(jws_t *jws, jwk_t *jwk_pubkey, int x5u_flags)
Definition: jws.c:1301
r_jws_copy
jws_t * r_jws_copy(jws_t *jws)
Definition: jws.c:738
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:871
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:885
r_jws_add_keys
int r_jws_add_keys(jws_t *jws, jwk_t *jwk_privkey, jwk_t *jwk_pubkey)
Definition: jws.c:942
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:1157
r_jws_get_payload
const unsigned char * r_jws_get_payload(jws_t *jws, size_t *payload_len)
Definition: jws.c:790
r_jws_get_jwks_privkey
jwks_t * r_jws_get_jwks_privkey(jws_t *jws)
Definition: jws.c:1182
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:899
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:1198
r_jws_serialize
char * r_jws_serialize(jws_t *jws, jwk_t *jwk_privkey, int x5u_flags)
Definition: jws.c:1381
r_jws_get_full_header_json_t
json_t * r_jws_get_full_header_json_t(jws_t *jws)
Definition: jws.c:935
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:1001
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:1079
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:1118
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:928
r_jws_add_jwks
int r_jws_add_jwks(jws_t *jws, jwks_t *jwks_privkey, jwks_t *jwks_pubkey)
Definition: jws.c:968
r_jws_set_payload
int r_jws_set_payload(jws_t *jws, const unsigned char *payload, size_t payload_len)
Definition: jws.c:765
r_jws_get_alg
jwa_alg r_jws_get_alg(jws_t *jws)
Definition: jws.c:863
r_jws_parse
int r_jws_parse(jws_t *jws, const char *jws_str, int x5u_flags)
Definition: jws.c:1297
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:1040
r_jws_get_header_str_value
const char * r_jws_get_header_str_value(jws_t *jws, const char *key)
Definition: jws.c:914
r_jws_set_alg
int r_jws_set_alg(jws_t *jws, jwa_alg alg)
Definition: jws.c:800
r_jws_get_jwks_pubkey
jwks_t * r_jws_get_jwks_pubkey(jws_t *jws)
Definition: jws.c:1190
r_jws_get_header_int_value
int r_jws_get_header_int_value(jws_t *jws, const char *key)
Definition: jws.c:921
r_jwt_serialize_signed
char * r_jwt_serialize_signed(jwt_t *jwt, jwk_t *privkey, int x5u_flags)
Definition: jwt.c:860
r_jwt_set_sign_alg
int r_jwt_set_sign_alg(jwt_t *jwt, jwa_alg alg)
Definition: jwt.c:800
r_jwt_get_sign_jwks_privkey
jwks_t * r_jwt_get_sign_jwks_privkey(jwt_t *jwt)
Definition: jwt.c:528
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_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_jwt_decrypt_nested
int r_jwt_decrypt_nested(jwt_t *jwt, jwk_t *decrypt_key, int decrypt_key_x5u_flags)
Definition: jwt.c:1380
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
r_jwt_verify_signature
int r_jwt_verify_signature(jwt_t *jwt, jwk_t *pubkey, int x5u_flags)
Definition: jwt.c:1157
r_jwt_get_full_claims_str
char * r_jwt_get_full_claims_str(jwt_t *jwt)
Definition: jwt.c:235
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
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_jwt_get_enc_jwks_pubkey
jwks_t * r_jwt_get_enc_jwks_pubkey(jwt_t *jwt)
Definition: jwt.c:792
r_jwt_copy
jwt_t * r_jwt_copy(jwt_t *jwt)
Definition: jwt.c:98
r_jwt_get_enc_alg
jwa_alg r_jwt_get_enc_alg(jwt_t *jwt)
Definition: jwt.c:832
r_jwt_get_enc
jwa_enc r_jwt_get_enc(jwt_t *jwt)
Definition: jwt.c:852
r_jwt_get_sign_jwks_pubkey
jwks_t * r_jwt_get_sign_jwks_pubkey(jwt_t *jwt)
Definition: jwt.c:536
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_jwt_set_enc_alg
int r_jwt_set_enc_alg(jwt_t *jwt, jwa_alg alg)
Definition: jwt.c:820
r_jwt_decrypt
int r_jwt_decrypt(jwt_t *jwt, jwk_t *privkey, int x5u_flags)
Definition: jwt.c:1182
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_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_jwt_get_claim_int_value
int r_jwt_get_claim_int_value(jwt_t *jwt, const char *key)
Definition: jwt.c:214
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_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
r_jwt_get_sign_alg
jwa_alg r_jwt_get_sign_alg(jwt_t *jwt)
Definition: jwt.c:812
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:1236
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
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_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:1477
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
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_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_jwt_validate_claims
int r_jwt_validate_claims(jwt_t *jwt,...)
Definition: jwt.c:1509
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_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_jwt_get_full_header_str
char * r_jwt_get_full_header_str(jwt_t *jwt)
Definition: jwt.c:175
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_jwt_parse
int r_jwt_parse(jwt_t *jwt, const char *token, int x5u_flags)
Definition: jwt.c:1145
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_jwt_add_sign_keys
int r_jwt_add_sign_keys(jwt_t *jwt, jwk_t *privkey, jwk_t *pubkey)
Definition: jwt.c:288
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_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
r_jwt_set_enc
int r_jwt_set_enc(jwt_t *jwt, jwa_enc enc)
Definition: jwt.c:840
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_add_enc_keys
int r_jwt_add_enc_keys(jwt_t *jwt, jwk_t *privkey, jwk_t *pubkey)
Definition: jwt.c:544
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_header_json_t_value
json_t * r_jwt_get_header_json_t_value(jwt_t *jwt, const char *key)
Definition: jwt.c:161
r_jwt_get_full_header_json_t
json_t * r_jwt_get_full_header_json_t(jwt_t *jwt)
Definition: jwt.c:168
r_jwt_serialize_encrypted
char * r_jwt_serialize_encrypted(jwt_t *jwt, jwk_t *pubkey, int x5u_flags)
Definition: jwt.c:901
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_get_full_claims_json_t
json_t * r_jwt_get_full_claims_json_t(jwt_t *jwt)
Definition: jwt.c:228
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_jwt_get_header_str_value
const char * r_jwt_get_header_str_value(jwt_t *jwt, const char *key)
Definition: jwt.c:147
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_enc_jwks_privkey
jwks_t * r_jwt_get_enc_jwks_privkey(jwt_t *jwt)
Definition: jwt.c:784
r_jwt_get_type
int r_jwt_get_type(jwt_t *jwt)
Definition: jwt.c:1149
jwa_enc
jwa_enc
Definition: rhonabwy.h:151
jwa_alg
jwa_alg
Definition: rhonabwy.h:115
jwk_t
json_t jwk_t
Definition: rhonabwy.h:112
jwks_t
json_t jwks_t
Definition: rhonabwy.h:113
R_JWA_ENC_UNKNOWN
@ R_JWA_ENC_UNKNOWN
Definition: rhonabwy.h:152
R_JWA_ENC_A192GCM
@ R_JWA_ENC_A192GCM
Definition: rhonabwy.h:157
R_JWA_ENC_A128GCM
@ R_JWA_ENC_A128GCM
Definition: rhonabwy.h:156
R_JWA_ENC_A128CBC
@ R_JWA_ENC_A128CBC
Definition: rhonabwy.h:153
R_JWA_ENC_A256GCM
@ R_JWA_ENC_A256GCM
Definition: rhonabwy.h:158
R_JWA_ENC_A192CBC
@ R_JWA_ENC_A192CBC
Definition: rhonabwy.h:154
R_JWA_ENC_A256CBC
@ R_JWA_ENC_A256CBC
Definition: rhonabwy.h:155
R_JWA_ALG_A256KW
@ R_JWA_ALG_A256KW
Definition: rhonabwy.h:136
R_JWA_ALG_A192GCMKW
@ R_JWA_ALG_A192GCMKW
Definition: rhonabwy.h:143
R_JWA_ALG_ES384
@ R_JWA_ALG_ES384
Definition: rhonabwy.h:125
R_JWA_ALG_A192KW
@ R_JWA_ALG_A192KW
Definition: rhonabwy.h:135
R_JWA_ALG_PBES2_H384
@ R_JWA_ALG_PBES2_H384
Definition: rhonabwy.h:146
R_JWA_ALG_HS384
@ R_JWA_ALG_HS384
Definition: rhonabwy.h:119
R_JWA_ALG_EDDSA
@ R_JWA_ALG_EDDSA
Definition: rhonabwy.h:127
R_JWA_ALG_DIR
@ R_JWA_ALG_DIR
Definition: rhonabwy.h:137
R_JWA_ALG_A128KW
@ R_JWA_ALG_A128KW
Definition: rhonabwy.h:134
R_JWA_ALG_HS512
@ R_JWA_ALG_HS512
Definition: rhonabwy.h:120
R_JWA_ALG_PS512
@ R_JWA_ALG_PS512
Definition: rhonabwy.h:130
R_JWA_ALG_PS384
@ R_JWA_ALG_PS384
Definition: rhonabwy.h:129
R_JWA_ALG_PBES2_H512
@ R_JWA_ALG_PBES2_H512
Definition: rhonabwy.h:147
R_JWA_ALG_NONE
@ R_JWA_ALG_NONE
Definition: rhonabwy.h:117
R_JWA_ALG_RSA1_5
@ R_JWA_ALG_RSA1_5
Definition: rhonabwy.h:131
R_JWA_ALG_ES256
@ R_JWA_ALG_ES256
Definition: rhonabwy.h:124
R_JWA_ALG_RSA_OAEP_256
@ R_JWA_ALG_RSA_OAEP_256
Definition: rhonabwy.h:133
R_JWA_ALG_A128GCMKW
@ R_JWA_ALG_A128GCMKW
Definition: rhonabwy.h:142
R_JWA_ALG_ECDH_ES_A192KW
@ R_JWA_ALG_ECDH_ES_A192KW
Definition: rhonabwy.h:140
R_JWA_ALG_ES512
@ R_JWA_ALG_ES512
Definition: rhonabwy.h:126
R_JWA_ALG_RS512
@ R_JWA_ALG_RS512
Definition: rhonabwy.h:123
R_JWA_ALG_RS256
@ R_JWA_ALG_RS256
Definition: rhonabwy.h:121
R_JWA_ALG_A256GCMKW
@ R_JWA_ALG_A256GCMKW
Definition: rhonabwy.h:144
R_JWA_ALG_ES256K
@ R_JWA_ALG_ES256K
Definition: rhonabwy.h:148
R_JWA_ALG_RS384
@ R_JWA_ALG_RS384
Definition: rhonabwy.h:122
R_JWA_ALG_UNKNOWN
@ R_JWA_ALG_UNKNOWN
Definition: rhonabwy.h:116
R_JWA_ALG_ECDH_ES_A128KW
@ R_JWA_ALG_ECDH_ES_A128KW
Definition: rhonabwy.h:139
R_JWA_ALG_ECDH_ES
@ R_JWA_ALG_ECDH_ES
Definition: rhonabwy.h:138
R_JWA_ALG_HS256
@ R_JWA_ALG_HS256
Definition: rhonabwy.h:118
R_JWA_ALG_PS256
@ R_JWA_ALG_PS256
Definition: rhonabwy.h:128
R_JWA_ALG_PBES2_H256
@ R_JWA_ALG_PBES2_H256
Definition: rhonabwy.h:145
R_JWA_ALG_RSA_OAEP
@ R_JWA_ALG_RSA_OAEP
Definition: rhonabwy.h:132
R_JWA_ALG_ECDH_ES_A256KW
@ R_JWA_ALG_ECDH_ES_A256KW
Definition: rhonabwy.h:141
_r_json_get_int_value
int _r_json_get_int_value(json_t *j_json, const char *key)
Definition: misc.c:165
_r_json_set_int_value
int _r_json_set_int_value(json_t *j_json, const char *key, int i_value)
Definition: misc.c:121
_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:137
_r_json_get_str_value
const char * _r_json_get_str_value(json_t *j_json, const char *key)
Definition: misc.c:158
_r_json_get_full_json_t
json_t * _r_json_get_full_json_t(json_t *j_json)
Definition: misc.c:181
_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:100
_r_json_get_json_t_value
json_t * _r_json_get_json_t_value(json_t *j_json, const char *key)
Definition: misc.c:172
jwe_t
Definition: rhonabwy.h:173
jwe_t::payload_len
size_t payload_len
Definition: rhonabwy.h:189
jwe_t::j_header
json_t * j_header
Definition: rhonabwy.h:179
jwe_t::iv
unsigned char * iv
Definition: rhonabwy.h:186
jwe_t::enc
jwa_enc enc
Definition: rhonabwy.h:181
jwe_t::jwks_privkey
jwks_t * jwks_privkey
Definition: rhonabwy.h:182
jwe_t::iv_b64url
unsigned char * iv_b64url
Definition: rhonabwy.h:176
jwe_t::key_len
size_t key_len
Definition: rhonabwy.h:185
jwe_t::auth_tag_b64url
unsigned char * auth_tag_b64url
Definition: rhonabwy.h:178
jwe_t::header_b64url
unsigned char * header_b64url
Definition: rhonabwy.h:174
jwe_t::ciphertext_b64url
unsigned char * ciphertext_b64url
Definition: rhonabwy.h:177
jwe_t::alg
jwa_alg alg
Definition: rhonabwy.h:180
jwe_t::key
unsigned char * key
Definition: rhonabwy.h:184
jwe_t::jwks_pubkey
jwks_t * jwks_pubkey
Definition: rhonabwy.h:183
jwe_t::payload
unsigned char * payload
Definition: rhonabwy.h:188
jwe_t::iv_len
size_t iv_len
Definition: rhonabwy.h:187
jwe_t::encrypted_key_b64url
unsigned char * encrypted_key_b64url
Definition: rhonabwy.h:175
jws_t
Definition: rhonabwy.h:161
jws_t::payload_len
size_t payload_len
Definition: rhonabwy.h:170
jws_t::jwks_pubkey
jwks_t * jwks_pubkey
Definition: rhonabwy.h:168
jws_t::jwks_privkey
jwks_t * jwks_privkey
Definition: rhonabwy.h:167
jws_t::payload
unsigned char * payload
Definition: rhonabwy.h:169
jws_t::payload_b64url
unsigned char * payload_b64url
Definition: rhonabwy.h:163
jws_t::j_header
json_t * j_header
Definition: rhonabwy.h:165
jws_t::signature_b64url
unsigned char * signature_b64url
Definition: rhonabwy.h:164
jws_t::alg
jwa_alg alg
Definition: rhonabwy.h:166
jws_t::header_b64url
unsigned char * header_b64url
Definition: rhonabwy.h:162
jwt_t
Definition: rhonabwy.h:192
jwt_t::enc_alg
jwa_alg enc_alg
Definition: rhonabwy.h:199
jwt_t::jwks_privkey_sign
jwks_t * jwks_privkey_sign
Definition: rhonabwy.h:201
jwt_t::j_claims
json_t * j_claims
Definition: rhonabwy.h:195
jwt_t::sign_alg
jwa_alg sign_alg
Definition: rhonabwy.h:198
jwt_t::enc
jwa_enc enc
Definition: rhonabwy.h:200
jwt_t::jwks_pubkey_enc
jwks_t * jwks_pubkey_enc
Definition: rhonabwy.h:204
jwt_t::type
int type
Definition: rhonabwy.h:193
jwt_t::jws
jws_t * jws
Definition: rhonabwy.h:196
jwt_t::jwks_privkey_enc
jwks_t * jwks_privkey_enc
Definition: rhonabwy.h:203
jwt_t::jwe
jwe_t * jwe
Definition: rhonabwy.h:197
jwt_t::j_header
json_t * j_header
Definition: rhonabwy.h:194
jwt_t::jwks_pubkey_sign
jwks_t * jwks_pubkey_sign
Definition: rhonabwy.h:202