Rhonabwy: src/jwe.c File Reference

Rhonabwy Create, modify, parse or export Json Web Keys as defined in the RFC 7517

Macros | Functions
jwe.c File Reference
`#include <string.h>`
`#include <ctype.h>`
`#include <gnutls/gnutls.h>`
`#include <gnutls/crypto.h>`
`#include <gnutls/abstract.h>`
`#include <gnutls/x509.h>`
`#include <orcania.h>`
`#include <yder.h>`
`#include <rhonabwy.h>`

## Macros
#define | R_TAG_MAX_SIZE 16
#define | _R_BLOCK_SIZE 256
#define | _R_PBES_DEFAULT_ITERATION 4096
#define | _R_PBES_DEFAULT_SALT_LENGTH 8

## Functions
int | r_jwe_init (jwe_t **jwe)
void | r_jwe_free (jwe_t *jwe)
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_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_set_aad (jwe_t *jwe, const unsigned char *aad, size_t aad_len)
const unsigned char * | r_jwe_get_aad (jwe_t *jwe, size_t *aad_len)
int | r_jwe_generate_iv (jwe_t *jwe)
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)
const char * | r_jwe_get_kid (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)
char * | r_jwe_get_full_header_str (jwe_t *jwe)
json_t * | r_jwe_get_full_unprotected_header_json_t (jwe_t *jwe)
char * | r_jwe_get_full_unprotected_header_str (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_encrypt_payload (jwe_t *jwe)
int | r_jwe_decrypt_payload (jwe_t *jwe)
int | r_jwe_encrypt_key (jwe_t *jwe, jwk_t *jwk_s, int x5u_flags)
int | r_jwe_decrypt_key (jwe_t *jwe, jwk_t *jwk_s, 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_compact_parsen (jwe_t *jwe, const char *jwe_str, size_t jwe_str_len, int x5u_flags)
int | r_jwe_compact_parse (jwe_t *jwe, const char *jwe_str, int x5u_flags)
int | r_jwe_parse_json_str (jwe_t *jwe, const char *jwe_json_str, int x5u_flags)
int | r_jwe_parsen_json_str (jwe_t *jwe, const char *jwe_json_str, size_t jwe_json_str_len, int x5u_flags)
int | r_jwe_parse_json_t (jwe_t *jwe, json_t *jwe_json, 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)
char * | r_jwe_serialize_json_str (jwe_t *jwe, jwks_t *jwks_pubkey, int x5u_flags, int mode)
json_t * | r_jwe_serialize_json_t (jwe_t *jwe, jwks_t *jwks_pubkey, int x5u_flags, int mode)
int | r_jwe_set_full_header_json_t (jwe_t *jwe, json_t *j_header)
int | r_jwe_set_full_header_json_str (jwe_t *jwe, const char *str_header)
int | r_jwe_set_full_unprotected_header_json_t (jwe_t *jwe, json_t *j_unprotected_header)
int | r_jwe_set_full_unprotected_header_json_str (jwe_t *jwe, const char *str_unprotected_header)
int | r_jwe_set_properties (jwe_t *jwe,...)

## Macro Definition Documentation

## ◆ R_TAG_MAX_SIZE

#define R_TAG_MAX_SIZE 16

Rhonabwy JSON Web Encryption (JWE) library

jwe.c: functions definitions

Copyright 2020-2021 Nicolas Mora mail@.nosp@m.babe.nosp@m.loues.nosp@m.t.or.nosp@m.g

This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; version 2.1 of the License.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU GENERAL PUBLIC LICENSE for more details.

You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses/.

## ◆ _R_BLOCK_SIZE

#define _R_BLOCK_SIZE 256

## ◆ _R_PBES_DEFAULT_ITERATION

#define _R_PBES_DEFAULT_ITERATION 4096

## ◆ _R_PBES_DEFAULT_SALT_LENGTH

#define _R_PBES_DEFAULT_SALT_LENGTH 8