libjwt-2.1.0
JWT Crypto Operations

Functions used to set and get which crypto operations are used More...

Functions

const char * jwt_get_crypto_ops (void)
 Retrieve the name of the current crypto operations being used.
 
int jwt_set_crypto_ops (const char *opname)
 Set the crypto operations to the named set.
 

Detailed Description

Functions used to set and get which crypto operations are used

LibJWT supports several crypto libaries, mainly "openssl" and "gnutls. By default, if enabled, "openssl" is used.

NOTE: Changing the crypto operations is not thread safe. You must protect changing them with some sort of lock, including locking around usage of the operations themselves.

ENVIRONMENT: You can set JWT_CRYPTO to the default operations you wish to use. If JWT_CRYPTO is invalid, an error message will be printed to the console when LibJWT is loaded by the application.

Function Documentation

◆ jwt_get_crypto_ops()

const char * jwt_get_crypto_ops ( void )

Retrieve the name of the current crypto operations being used.

Returns
name of the crypto operation set

◆ jwt_set_crypto_ops()

int jwt_set_crypto_ops ( const char * opname)

Set the crypto operations to the named set.

The opname is one of the available operators in the compiled version of LibJWT. Most times, this is either "openssl" or "gnutls".

Parameters
opnamethe name of the crypto operation to set
Returns
0 on success, valid errno otherwise.