|
Rhonabwy
Create, modify, parse or export Json Web Keys as defined in the RFC 7517
|
Functions | |
| jwe_t * | r_jwe_copy (jwe_t *jwe) |
| int | r_jwe_set_payload (jwe_t *jwe, const unsigned char *payload, size_t payload_len) |
| const unsigned char * | r_jwe_get_payload (jwe_t *jwe, size_t *payload_len) |
| int | r_jwe_set_alg (jwe_t *jwe, jwa_alg alg) |
| jwa_alg | r_jwe_get_alg (jwe_t *jwe) |
| int | r_jwe_set_enc (jwe_t *jwe, jwa_enc enc) |
| jwa_enc | r_jwe_get_enc (jwe_t *jwe) |
| int | r_jwe_set_header_str_value (jwe_t *jwe, const char *key, const char *str_value) |
| int | r_jwe_set_header_int_value (jwe_t *jwe, const char *key, int i_value) |
| int | r_jwe_set_header_json_t_value (jwe_t *jwe, const char *key, json_t *j_value) |
| const char * | r_jwe_get_header_str_value (jwe_t *jwe, const char *key) |
| int | r_jwe_get_header_int_value (jwe_t *jwe, const char *key) |
| json_t * | r_jwe_get_header_json_t_value (jwe_t *jwe, const char *key) |
| json_t * | r_jwe_get_full_header_json_t (jwe_t *jwe) |
| int | r_jwe_add_keys (jwe_t *jwe, jwk_t *jwk_privkey, jwk_t *jwk_pubkey) |
| int | r_jwe_add_jwks (jwe_t *jwe, jwks_t *jwks_privkey, jwks_t *jwks_pubkey) |
| int | r_jwe_add_keys_json_str (jwe_t *jwe, const char *privkey, const char *pubkey) |
| int | r_jwe_add_keys_json_t (jwe_t *jwe, json_t *privkey, json_t *pubkey) |
| 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) |
| int | r_jwe_add_keys_gnutls (jwe_t *jwe, gnutls_privkey_t privkey, gnutls_pubkey_t pubkey) |
| int | r_jwe_add_key_symmetric (jwe_t *jwe, const unsigned char *key, size_t key_len) |
| jwks_t * | r_jwe_get_jwks_privkey (jwe_t *jwe) |
| jwks_t * | r_jwe_get_jwks_pubkey (jwe_t *jwe) |
| int | r_jwe_set_cypher_key (jwe_t *jwe, const unsigned char *key, size_t key_len) |
| const unsigned char * | r_jwe_get_cypher_key (jwe_t *jwe, size_t *key_len) |
| int | r_jwe_generate_cypher_key (jwe_t *jwe) |
| int | r_jwe_set_iv (jwe_t *jwe, const unsigned char *iv, size_t iv_len) |
| const unsigned char * | r_jwe_get_iv (jwe_t *jwe, size_t *iv_len) |
| int | r_jwe_generate_iv (jwe_t *jwe) |
| int | r_jwe_encrypt_payload (jwe_t *jwe) |
| int | r_jwe_decrypt_payload (jwe_t *jwe) |
| int | r_jwe_encrypt_key (jwe_t *jwe, jwk_t *jwk_pubkey, int x5u_flags) |
| int | r_jwe_decrypt_key (jwe_t *jwe, jwk_t *jwk_privkey, int x5u_flags) |
| int | r_jwe_parse (jwe_t *jwe, const char *jwe_str, int x5u_flags) |
| int | r_jwe_parsen (jwe_t *jwe, const char *jwe_str, size_t jwe_str_len, int x5u_flags) |
| int | r_jwe_decrypt (jwe_t *jwe, jwk_t *jwk_privkey, int x5u_flags) |
| char * | r_jwe_serialize (jwe_t *jwe, jwk_t *jwk_pubkey, int x5u_flags) |
Manage JSON Web Encryption
| int r_jwe_set_payload | ( | jwe_t * | jwe, |
| const unsigned char * | payload, | ||
| size_t | payload_len | ||
| ) |
Set the payload of the jwe
| jwe | the jwe_t to update |
| payload | the payload to set |
| payload_len | the size of the payload |
| const unsigned char* r_jwe_get_payload | ( | jwe_t * | jwe, |
| size_t * | payload_len | ||
| ) |
Get the JWE payload
| jwe | the jwe_t to get the payload from |
| payload_len | the length of the JWE payload, may be NULL |
Set the JWE alg to use for key encryption
| jwe | the jwe_t to update |
| alg | the algorithm to use |
Set the JWE enc to use for payload encryption
| jwe | the jwe_t to update |
| enc | the encorithm to use |
Get the JWE enc used for payload encryption
| jwe | the jwe_t to update |
| int r_jwe_set_header_str_value | ( | jwe_t * | jwe, |
| const char * | key, | ||
| const char * | str_value | ||
| ) |
Adds a string value to the JWE header
| jwe | the jwe_t to update |
| key | the key to set to the JWE header |
| str_value | the value to set |
| int r_jwe_set_header_int_value | ( | jwe_t * | jwe, |
| const char * | key, | ||
| int | i_value | ||
| ) |
Adds an integer value to the JWE header
| jwe | the jwe_t to update |
| key | the key to set to the JWE header |
| i_value | the value to set |
| int r_jwe_set_header_json_t_value | ( | jwe_t * | jwe, |
| const char * | key, | ||
| json_t * | j_value | ||
| ) |
Adds a JSON value to the JWE header
| jwe | the jwe_t to update |
| key | the key to set to the JWE header |
| j_value | the value to set |
| const char* r_jwe_get_header_str_value | ( | jwe_t * | jwe, |
| const char * | key | ||
| ) |
Gets a string value from the JWE header
| jwe | the jwe_t to get the value |
| key | the key to retreive the value |
| int r_jwe_get_header_int_value | ( | jwe_t * | jwe, |
| const char * | key | ||
| ) |
Gets an integer value from the JWE header
| jwe | the jwe_t to get the value |
| key | the key to retreive the value |
| json_t* r_jwe_get_header_json_t_value | ( | jwe_t * | jwe, |
| const char * | key | ||
| ) |
Gets a JSON value from the JWE header
| jwe | the jwe_t to get the value |
| key | the key to retreive the value |
| json_t* r_jwe_get_full_header_json_t | ( | jwe_t * | jwe | ) |
Return the full JWE header in JSON format
| jwe | the jwe_t to get the value |
Adds private and/or public keys for the cypher key encryption and decryption
| jwe | the jwe_t to update |
| jwk_privkey | the private key in jwk_t * format, can be NULL |
| jwk_pubkey | the public key in jwk_t * format, can be NULL |
Adds private and/or public keys sets for the cypher key encryption and decryption
| jwe | the jwe_t to update |
| jwks_privkey | the private key set in jwks_t * format, can be NULL |
| jwks_pubkey | the public key set in jwks_t * format, can be NULL |
| int r_jwe_add_keys_json_str | ( | jwe_t * | jwe, |
| const char * | privkey, | ||
| const char * | pubkey | ||
| ) |
Add keys to perform encryption ot decryption keys must be a JWK stringified
| jwe | the jwe_t to update |
| privkey | the private key to enc the |
| pubkey | the public key to verify the encature |
| int r_jwe_add_keys_json_t | ( | jwe_t * | jwe, |
| json_t * | privkey, | ||
| json_t * | pubkey | ||
| ) |
Add keys to perform encryption ot decryption keys must be a JWK in json_t * format
| jwe | the jwe_t to update |
| privkey | the private key to enc the |
| pubkey | the public key to verify the encature |
| 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 | ||
| ) |
Add keys to perform encryption ot decryption keys must be in PEM or DER format
| jwe | the jwe_t to update |
| format | the format of the input, values available are R_FORMAT_PEM or R_FORMAT_DER |
| privkey | the private key to sign the |
| privkey_len | length of privkey |
| pubkey | the public key to verify the signature |
| pubkey_len | length of pubkey |
| int r_jwe_add_keys_gnutls | ( | jwe_t * | jwe, |
| gnutls_privkey_t | privkey, | ||
| gnutls_pubkey_t | pubkey | ||
| ) |
Add keys to perform encryption ot decryption keys must be gnutls key structures
| jwe | the jwe_t to update |
| privkey | the private key to enc the |
| pubkey | the public key to verify the encature |
| int r_jwe_add_key_symmetric | ( | jwe_t * | jwe, |
| const unsigned char * | key, | ||
| size_t | key_len | ||
| ) |
Add symmetric key by value to perform encryption ot decryption
| jwe | the jwe_t to update |
| key | the raw key value |
| key_len | the length of the key |
Get private keys set for the cypher key decryption
| jwe | the jwe_t to get the value |
Get public keys set for the cypher key encryption
| jwe | the jwe_t to get the value |
| int r_jwe_set_cypher_key | ( | jwe_t * | jwe, |
| const unsigned char * | key, | ||
| size_t | key_len | ||
| ) |
Sets the cypher key to encrypt or decrypt the payload
| jwe | the jwe_t to update |
| key | the key to encrypt or decrypt the payload |
| key_len | the size of the key |
| const unsigned char* r_jwe_get_cypher_key | ( | jwe_t * | jwe, |
| size_t * | key_len | ||
| ) |
Gets the cypher key to encrypt or decrypt the payload
| jwe | the jwe_t to get the value |
| key_len | set the size of the key, may be NULL |
| int r_jwe_generate_cypher_key | ( | jwe_t * | jwe | ) |
Generates a random cypher key
| jwe | the jwe_t to update |
| int r_jwe_set_iv | ( | jwe_t * | jwe, |
| const unsigned char * | iv, | ||
| size_t | iv_len | ||
| ) |
Sets the Initialization Vector (iv)
| jwe | the jwe_t to update |
| iv | the iv to set |
| iv_len | the size of the iv |
| const unsigned char* r_jwe_get_iv | ( | jwe_t * | jwe, |
| size_t * | iv_len | ||
| ) |
Gets the Initialization Vector (iv)
| jwe | the jwe_t to get the value |
| iv_len | set the size of the iv, may be NULL |
| int r_jwe_generate_iv | ( | jwe_t * | jwe | ) |
Generates a random Initialization Vector (iv)
| jwe | the jwe_t to update |
| int r_jwe_encrypt_payload | ( | jwe_t * | jwe | ) |
Encrypts the payload using its key and iv
| jwe | the jwe_t to update |
| int r_jwe_decrypt_payload | ( | jwe_t * | jwe | ) |
Decrypts the payload using its key and iv
| jwe | the jwe_t to update |
Encrypts the key
| jwe | the jwe_t to update |
| jwk_pubkey | the jwk to encrypt the key, may be NULL |
| x5u_flags | Flags to retrieve x5u certificates pointed by x5u if necessary, could be 0 if not needed Flags available are
|
Decrypts the key
| jwe | the jwe_t to update |
| jwk_privkey | the jwk to decrypt the key, may be NULL |
| x5u_flags | Flags to retrieve x5u certificates pointed by x5u if necessary, could be 0 if not needed Flags available are
|
| int r_jwe_parse | ( | jwe_t * | jwe, |
| const char * | jwe_str, | ||
| int | x5u_flags | ||
| ) |
Parses the JWE
| jwe | the jwe_t to update |
| jwe_str | the jwe serialized to parse, must end with a NULL string terminator |
| x5u_flags | Flags to retrieve x5u certificates pointed by x5u if necessary, could be 0 if not needed Flags available are
|
| int r_jwe_parsen | ( | jwe_t * | jwe, |
| const char * | jwe_str, | ||
| size_t | jwe_str_len, | ||
| int | x5u_flags | ||
| ) |
Parses the JWE
| jwe | the jwe_t to update |
| jwe_str | the jwe serialized to parse |
| jwe_str_len | the length of jwe_str |
| x5u_flags | Flags to retrieve x5u certificates pointed by x5u if necessary, could be 0 if not needed Flags available are
|
Decrypts the payload of the JWE
| jwe | the jwe_t to update |
| jwk_privkey | the private key to decrypt cypher key, can be NULL if jwe already contains a private key |
| x5u_flags | Flags to retrieve x5u certificates pointed by x5u if necessary, could be 0 if not needed Flags available are
|
Serialize a JWE into its string format (aaa.bbb.ccc.xxx.yyy.zzz)
| jwe | the JWE to serialize |
| jwk_pubkey | the public key to encrypt the cypher key, can be NULL if jwe already contains a public key |
| x5u_flags | Flags to retrieve x5u certificates pointed by x5u if necessary, could be 0 if not needed Flags available are
|