Rhonabwy
Javascript Object Signing and Encryption (JOSE) library - JWK, JWKS, JWS, JWE and JWT
Functions
Core functions

Functions

int r_global_init (void)
 
void r_global_close (void)
 
json_t * r_library_info_json_t (void)
 
char * r_library_info_json_str (void)
 
void r_free (void *data)
 
int r_jwk_init (jwk_t **jwk)
 
void r_jwk_free (jwk_t *jwk)
 
int r_jwks_init (jwks_t **jwks)
 
void r_jwks_free (jwks_t *jwks)
 
int r_jws_init (jws_t **jws)
 
void r_jws_free (jws_t *jws)
 
int r_jwe_init (jwe_t **jwe)
 
void r_jwe_free (jwe_t *jwe)
 
int r_jwt_init (jwt_t **jwt)
 
void r_jwt_free (jwt_t *jwt)
 
jwa_alg r_str_to_jwa_alg (const char *alg)
 
const char * r_jwa_alg_to_str (jwa_alg alg)
 
jwa_enc r_str_to_jwa_enc (const char *enc)
 
const char * r_jwa_enc_to_str (jwa_enc enc)
 

Detailed Description

Core functions used to initialize or free jwk_t and check if a jwk is valid and its type

Function Documentation

◆ r_free()

void r_free ( void *  data)

Free a heap allocated variable previously returned by a rhonabwy function

Parameters
datathe data to free

◆ r_global_close()

void r_global_close ( void  )

Close rhonabwy global parameters

◆ r_global_init()

int r_global_init ( void  )

Initialize rhonabwy global parameters This function isn't thread-safe so it must be called once before any other call to rhonabwy functions The function r_global_close must be called when rhonabwy library is no longer required

Returns
RHN_OK on success, an error value on error

◆ r_jwa_alg_to_str()

const char * r_jwa_alg_to_str ( jwa_alg  alg)

Get the algorithm string corresponding to the jwa_alg

Parameters
algthe algorithm to convert
Returns
its string name

◆ r_jwa_enc_to_str()

const char * r_jwa_enc_to_str ( jwa_enc  enc)

Get the encryption string corresponding to the jwa_enc

Parameters
encthe encryption to convert
Returns
its string name

◆ r_jwe_free()

void r_jwe_free ( jwe_t jwe)

Free a jwe_t

Parameters
jwethe jwe_t * to free

◆ r_jwe_init()

int r_jwe_init ( jwe_t **  jwe)

Initialize a jwe_t

Parameters
jwea reference to a jwe_t * to initialize
Returns
RHN_OK on success, an error value on error

◆ r_jwk_free()

void r_jwk_free ( jwk_t jwk)

Free a jwk_t

Parameters
jwkthe jwk_t * to free

◆ r_jwk_init()

int r_jwk_init ( jwk_t **  jwk)

Initialize a jwk_t

Parameters
jwka reference to a jwk_t * to initialize
Returns
RHN_OK on success, an error value on error

◆ r_jwks_free()

void r_jwks_free ( jwks_t jwks)

Free a jwks_t

Parameters
jwksthe jwks_t * to free

◆ r_jwks_init()

int r_jwks_init ( jwks_t **  jwks)

Initialize a jwks_t

Parameters
jwksa reference to a jwks_t * to initialize
Returns
RHN_OK on success, an error value on error

◆ r_jws_free()

void r_jws_free ( jws_t jws)

Free a jws_t

Parameters
jwsthe jws_t * to free

◆ r_jws_init()

int r_jws_init ( jws_t **  jws)

Initialize a jws_t

Parameters
jwsa reference to a jws_t * to initialize
Returns
RHN_OK on success, an error value on error

◆ r_jwt_free()

void r_jwt_free ( jwt_t jwt)

Free a jwt_t

Parameters
jwtthe jwt_t * to free

◆ r_jwt_init()

int r_jwt_init ( jwt_t **  jwt)

Initialize a jwt_t

Parameters
jwta reference to a jwt_t * to initialize
Returns
RHN_OK on success, an error value on error

Rhonabwy JSON Web Token (JWT) library

jwt.c: functions definitions

Copyright 2020-2022 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_library_info_json_str()

char * r_library_info_json_str ( void  )

Get the library information as a JSON object in string format

  • library version
  • supported JWS algorithms
  • supported JWE algorithms
    Returns
    the library information, must be r_free'd after use

◆ r_library_info_json_t()

json_t * r_library_info_json_t ( void  )

Get the library information as a json_t * object

  • library version
  • supported JWS algorithms
  • supported JWE algorithms
    Returns
    the library information

◆ r_str_to_jwa_alg()

jwa_alg r_str_to_jwa_alg ( const char *  alg)

Get the jwa_alg corresponding to the string algorithm specified

Parameters
algthe algorithm to convert
Returns
the converted jwa_alg, R_JWA_ALG_NONE if alg is unknown

◆ r_str_to_jwa_enc()

jwa_enc r_str_to_jwa_enc ( const char *  enc)

Get the jwa_enc corresponding to the string algorithm specified

Parameters
encthe algorithm to convert
Returns
the converted jwa_enc, R_JWA_ENC_NONE if enc is unknown