Rhonabwy
Javascript Object Signing and Encryption (JOSE) library - JWK, JWKS, JWS, JWE and JWT
|
Functions | |
int | r_jwt_set_properties (jwt_t *jwt,...) |
jwt_t * | r_jwt_copy (jwt_t *jwt) |
int | r_jwt_set_header_str_value (jwt_t *jwt, const char *key, const char *str_value) |
int | r_jwt_set_header_int_value (jwt_t *jwt, const char *key, rhn_int_t i_value) |
int | r_jwt_set_header_json_t_value (jwt_t *jwt, const char *key, json_t *j_value) |
int | r_jwt_set_full_header_json_t (jwt_t *jwt, json_t *j_header) |
int | r_jwt_set_full_header_json_str (jwt_t *jwt, const char *str_header) |
const char * | r_jwt_get_header_str_value (jwt_t *jwt, const char *key) |
rhn_int_t | r_jwt_get_header_int_value (jwt_t *jwt, const char *key) |
json_t * | r_jwt_get_header_json_t_value (jwt_t *jwt, const char *key) |
json_t * | r_jwt_get_full_header_json_t (jwt_t *jwt) |
char * | r_jwt_get_full_header_str (jwt_t *jwt) |
int | r_jwt_set_claim_str_value (jwt_t *jwt, const char *key, const char *str_value) |
int | r_jwt_set_claim_int_value (jwt_t *jwt, const char *key, rhn_int_t i_value) |
int | r_jwt_set_claim_json_t_value (jwt_t *jwt, const char *key, json_t *j_value) |
const char * | r_jwt_get_claim_str_value (jwt_t *jwt, const char *key) |
rhn_int_t | r_jwt_get_claim_int_value (jwt_t *jwt, const char *key) |
json_t * | r_jwt_get_claim_json_t_value (jwt_t *jwt, const char *key) |
json_t * | r_jwt_get_full_claims_json_t (jwt_t *jwt) |
char * | r_jwt_get_full_claims_str (jwt_t *jwt) |
int | r_jwt_set_full_claims_json_t (jwt_t *jwt, json_t *j_claim) |
int | r_jwt_set_full_claims_json_str (jwt_t *jwt, const char *str_claims) |
int | r_jwt_append_claims_json_t (jwt_t *jwt, json_t *j_claim) |
int | r_jwt_add_sign_keys (jwt_t *jwt, jwk_t *privkey, jwk_t *pubkey) |
int | r_jwt_add_sign_jwks (jwt_t *jwt, jwks_t *jwks_privkey, jwks_t *jwks_pubkey) |
int | r_jwt_add_sign_keys_json_str (jwt_t *jwt, const char *privkey, const char *pubkey) |
int | r_jwt_add_sign_keys_json_t (jwt_t *jwt, json_t *privkey, json_t *pubkey) |
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) |
int | r_jwt_add_sign_keys_gnutls (jwt_t *jwt, gnutls_privkey_t privkey, gnutls_pubkey_t pubkey) |
int | r_jwt_add_sign_key_symmetric (jwt_t *jwt, const unsigned char *key, size_t key_len) |
jwks_t * | r_jwt_get_sign_jwks_privkey (jwt_t *jwt) |
jwks_t * | r_jwt_get_sign_jwks_pubkey (jwt_t *jwt) |
int | r_jwt_add_enc_keys (jwt_t *jwt, jwk_t *privkey, jwk_t *pubkey) |
int | r_jwt_add_enc_jwks (jwt_t *jwt, jwks_t *jwks_privkey, jwks_t *jwks_pubkey) |
int | r_jwt_add_enc_keys_json_str (jwt_t *jwt, const char *privkey, const char *pubkey) |
int | r_jwt_add_enc_keys_json_t (jwt_t *jwt, json_t *privkey, json_t *pubkey) |
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) |
int | r_jwt_add_enc_keys_gnutls (jwt_t *jwt, gnutls_privkey_t privkey, gnutls_pubkey_t pubkey) |
int | r_jwt_add_enc_key_symmetric (jwt_t *jwt, const unsigned char *key, size_t key_len) |
jwks_t * | r_jwt_get_enc_jwks_privkey (jwt_t *jwt) |
jwks_t * | r_jwt_get_enc_jwks_pubkey (jwt_t *jwt) |
int | r_jwt_set_sign_alg (jwt_t *jwt, jwa_alg alg) |
jwa_alg | r_jwt_get_sign_alg (jwt_t *jwt) |
int | r_jwt_set_enc_alg (jwt_t *jwt, jwa_alg alg) |
jwa_alg | r_jwt_get_enc_alg (jwt_t *jwt) |
int | r_jwt_set_enc (jwt_t *jwt, jwa_enc enc) |
jwa_enc | r_jwt_get_enc (jwt_t *jwt) |
const char * | r_jwt_get_enc_kid (jwt_t *jwt) |
const char * | r_jwt_get_sig_kid (jwt_t *jwt) |
int | r_jwt_set_enc_cypher_key (jwt_t *jwt, const unsigned char *key, size_t key_len) |
const unsigned char * | r_jwt_get_enc_cypher_key (jwt_t *jwt, size_t *key_len) |
int | r_jwt_generate_enc_cypher_key (jwt_t *jwt) |
int | r_jwt_set_enc_iv (jwt_t *jwt, const unsigned char *iv, size_t iv_len) |
const unsigned char * | r_jwt_get_enc_iv (jwt_t *jwt, size_t *iv_len) |
int | r_jwt_generate_iv (jwt_t *jwt) |
char * | r_jwt_serialize_signed (jwt_t *jwt, jwk_t *privkey, int x5u_flags) |
char * | r_jwt_serialize_signed_unsecure (jwt_t *jwt, jwk_t *privkey, int x5u_flags) |
char * | r_jwt_serialize_encrypted (jwt_t *jwt, jwk_t *pubkey, int x5u_flags) |
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) |
int | r_jwt_parse (jwt_t *jwt, const char *token, int x5u_flags) |
int | r_jwt_parsen (jwt_t *jwt, const char *token, size_t token_len, int x5u_flags) |
int | r_jwt_parse_unsecure (jwt_t *jwt, const char *token, int x5u_flags) |
int | r_jwt_parsen_unsecure (jwt_t *jwt, const char *token, size_t token_len, int x5u_flags) |
int | r_jwt_advanced_parse (jwt_t *jwt, const char *token, uint32_t parse_flags, int x5u_flags) |
int | r_jwt_advanced_parsen (jwt_t *jwt, const char *token, size_t token_len, uint32_t parse_flags, int x5u_flags) |
jwt_t * | r_jwt_quick_parse (const char *token, uint32_t parse_flags, int x5u_flags) |
jwt_t * | r_jwt_quick_parsen (const char *token, size_t token_len, uint32_t parse_flags, int x5u_flags) |
int | r_jwt_get_type (jwt_t *jwt) |
int | r_jwt_token_type (const char *token) |
int | r_jwt_token_typen (const char *token, size_t token_len) |
int | r_jwt_verify_signature (jwt_t *jwt, jwk_t *pubkey, int x5u_flags) |
int | r_jwt_decrypt (jwt_t *jwt, jwk_t *privkey, int x5u_flags) |
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) |
int | r_jwt_decrypt_nested (jwt_t *jwt, jwk_t *decrypt_key, int decrypt_key_x5u_flags) |
int | r_jwt_verify_signature_nested (jwt_t *jwt, jwk_t *verify_key, int verify_key_x5u_flags) |
int | r_jwt_validate_claims (jwt_t *jwt,...) |
int | r_jwt_set_claims (jwt_t *jwt,...) |
Manage JSON Web Token
Adds private and/or public keys sets for the cypher key encryption and decryption
jwt | the jwt_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_jwt_add_enc_key_symmetric | ( | jwt_t * | jwt, |
const unsigned char * | key, | ||
size_t | key_len | ||
) |
Add symmetric key by value to perform encryption ot decryption to the JWT
jwt | the jwt_t to update |
key | the raw key value |
key_len | the length of the key |
Add keys to perform encryption ot decryption to the JWT
jwt | the jwt_t to update |
privkey | the private key to decrypt the JWT |
pubkey | the public key to encrypt the JWT |
int r_jwt_add_enc_keys_gnutls | ( | jwt_t * | jwt, |
gnutls_privkey_t | privkey, | ||
gnutls_pubkey_t | pubkey | ||
) |
Add keys to perform encryption ot decryption to the JWT keys must be gnutls key structures
jwt | the jwt_t to update |
privkey | the private key to enc the JWT |
pubkey | the public key to verify the JWT encature |
int r_jwt_add_enc_keys_json_str | ( | jwt_t * | jwt, |
const char * | privkey, | ||
const char * | pubkey | ||
) |
Add keys to perform encryption ot decryption to the JWT keys must be a JWK stringified
jwt | the jwt_t to update |
privkey | the private key to enc the JWT |
pubkey | the public key to verify the JWT encature |
int r_jwt_add_enc_keys_json_t | ( | jwt_t * | jwt, |
json_t * | privkey, | ||
json_t * | pubkey | ||
) |
Add keys to perform encryption ot decryption to the JWT keys must be a JWK in json_t * format
jwt | the jwt_t to update |
privkey | the private key to enc the JWT |
pubkey | the public key to verify the JWT encature |
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 | ||
) |
Add keys to perform encryption ot decryption to the JWT keys must be in PEM or DER format
jwt | the jwt_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 |
Adds private and/or public keys sets for the signature and verification
jwt | the jwt_t to update |
jwks_privkey | the private key set in jwk_t * format, can be NULL |
jwks_pubkey | the public key set in jwk_t * format, can be NULL |
int r_jwt_add_sign_key_symmetric | ( | jwt_t * | jwt, |
const unsigned char * | key, | ||
size_t | key_len | ||
) |
Add symmetric key by value to perform signature or signature verification to the JWT
jwt | the jwt_t to update |
key | the raw key value |
key_len | the length of the key |
Add keys to perform signature or signature verification to the JWT
jwt | the jwt_t to update |
privkey | the private key to sign the JWT |
pubkey | the public key to verify the JWT signature |
int r_jwt_add_sign_keys_gnutls | ( | jwt_t * | jwt, |
gnutls_privkey_t | privkey, | ||
gnutls_pubkey_t | pubkey | ||
) |
Add keys to perform signature or signature verification to the JWT keys must be gnutls key structures
jwt | the jwt_t to update |
privkey | the private key to sign the JWT |
pubkey | the public key to verify the JWT signature |
int r_jwt_add_sign_keys_json_str | ( | jwt_t * | jwt, |
const char * | privkey, | ||
const char * | pubkey | ||
) |
Add keys to perform signature or signature verification to the JWT keys must be a JWK stringified
jwt | the jwt_t to update |
privkey | the private key to sign the JWT |
pubkey | the public key to verify the JWT signature |
int r_jwt_add_sign_keys_json_t | ( | jwt_t * | jwt, |
json_t * | privkey, | ||
json_t * | pubkey | ||
) |
Add keys to perform signature or signature verification to the JWT keys must be a JWK in json_t * format
jwt | the jwt_t to update |
privkey | the private key to sign the JWT |
pubkey | the public key to verify the JWT signature |
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 | ||
) |
Add keys to perform signature or signature verification to the JWT keys must be in PEM or DER format
jwt | the jwt_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_jwt_advanced_parse | ( | jwt_t * | jwt, |
const char * | token, | ||
uint32_t | parse_flags, | ||
int | x5u_flags | ||
) |
Parses a serialized JWT If the JWT is signed only, the claims will be available If the JWT is encrypted, the claims will not be accessible until r_jwt_decrypt or r_jwt_decrypt_verify_signature_nested is succesfull
jwt | the jwt that will contain the parsed token |
token | the token to parse into a JWT, must end with a NULL string terminator |
parse_flags | Flags to set or unset options Flags available are
|
x5u_flags | Flags to retrieve x5u certificates pointed by x5u if necessary, could be 0 if not needed Flags available are
|
int r_jwt_advanced_parsen | ( | jwt_t * | jwt, |
const char * | token, | ||
size_t | token_len, | ||
uint32_t | parse_flags, | ||
int | x5u_flags | ||
) |
Parses a serialized JWT If the JWT is signed only, the claims will be available If the JWT is encrypted, the claims will not be accessible until r_jwt_decrypt or r_jwt_decrypt_verify_signature_nested is succesfull
jwt | the jwt that will contain the parsed token |
token | the token to parse into a JWT |
token_len | token length |
parse_flags | Flags to set or unset options Flags available are
|
x5u_flags | Flags to retrieve x5u certificates pointed by x5u if necessary, could be 0 if not needed Flags available are
|
int r_jwt_append_claims_json_t | ( | jwt_t * | jwt, |
json_t * | j_claim | ||
) |
Append the given JSON object in the JWT payload Replace existing claim if already set
jwt | the jwt_t to get the value |
j_claim | the payload to set, must be JSON object |
Decrypts the payload of the JWT
jwt | the jwt_t to decrypt |
privkey | the private key to decrypt cypher key, can be NULL if jwt already contains a private key |
x5u_flags | Flags to retrieve x5u certificates in privkey pointed by x5u if necessary, could be 0 if not needed Flags available are
|
Decrypts a nested JWT, do not verify the signature Fills the claims if the decryption is succesfull
jwt | the jwt_t to decrypt and verify signature |
decrypt_key | the private key to decrypt cypher key, can be NULL if jwt already contains a private key |
decrypt_key_x5u_flags | Flags to retrieve x5u certificates in decrypt_key pointed by x5u if necessary, could be 0 if not needed Flags available are
|
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 | ||
) |
Decrypts and verifies the signature of a nested JWT Fills the claims if the decryption and signature verifiation are succesfull
jwt | the jwt_t to decrypt and verify signature |
verify_key | the public key to check the signature, can be NULL if jws already contains a public key |
verify_key_x5u_flags | Flags to retrieve x5u certificates in verify_key pointed by x5u if necessary, could be 0 if not needed Flags available are
|
decrypt_key | the private key to decrypt cypher key, can be NULL if jwt already contains a private key |
decrypt_key_x5u_flags | Flags to retrieve x5u certificates in decrypt_key pointed by x5u if necessary, could be 0 if not needed Flags available are
|
int r_jwt_generate_enc_cypher_key | ( | jwt_t * | jwt | ) |
Generates a random cypher key
jwt | the jwt_t to update |
int r_jwt_generate_iv | ( | jwt_t * | jwt | ) |
Generates a random Initialization Vector (iv)
jwt | the jwt_t to update |
Gets an integer value from the JWT claim
jwt | the jwt_t to get the value |
key | the key to retreive the value |
json_t * r_jwt_get_claim_json_t_value | ( | jwt_t * | jwt, |
const char * | key | ||
) |
Gets a JSON value from the JWT claim
jwt | the jwt_t to get the value |
key | the key to retreive the value |
const char * r_jwt_get_claim_str_value | ( | jwt_t * | jwt, |
const char * | key | ||
) |
Gets a string value from the JWT claim
jwt | the jwt_t to get the value |
key | the key to retreive the value |
Get the JWT enc used for payload encryption
jwt | the jwt_t |
Get the JWT alg used for key encryption
jwt | the jwt_t |
const unsigned char * r_jwt_get_enc_cypher_key | ( | jwt_t * | jwt, |
size_t * | key_len | ||
) |
Gets the cypher key to encrypt or decrypt the payload
jwt | the jwt_t to get the value |
key_len | set the size of the key, may be NULL |
const unsigned char * r_jwt_get_enc_iv | ( | jwt_t * | jwt, |
size_t * | iv_len | ||
) |
Gets the Initialization Vector (iv)
jwt | the jwt_t to get the value |
iv_len | set the size of the iv, may be NULL |
Get private keys set for the cypher key decryption
jwt | the jwt_t to get the value |
Get public keys set for the cypher key encryption
jwt | the jwt_t to get the value |
const char * r_jwt_get_enc_kid | ( | jwt_t * | jwt | ) |
json_t * r_jwt_get_full_claims_json_t | ( | jwt_t * | jwt | ) |
Return the full JWT claim in JSON format
jwt | the jwt_t to get the value |
char * r_jwt_get_full_claims_str | ( | jwt_t * | jwt | ) |
Return the full JWT claims in char *
jwt | the jwt_t to get the value |
json_t * r_jwt_get_full_header_json_t | ( | jwt_t * | jwt | ) |
Return the full JWT header in JSON format
jwt | the jwt_t to get the value |
char * r_jwt_get_full_header_str | ( | jwt_t * | jwt | ) |
Return the full JWT header in char *
jwt | the jwt_t to get the value |
Gets an integer value from the JWT header
jwt | the jwt_t to get the value |
key | the key to retreive the value |
json_t * r_jwt_get_header_json_t_value | ( | jwt_t * | jwt, |
const char * | key | ||
) |
Gets a JSON value from the JWT header
jwt | the jwt_t to get the value |
key | the key to retreive the value |
const char * r_jwt_get_header_str_value | ( | jwt_t * | jwt, |
const char * | key | ||
) |
Gets a string value from the JWT header
jwt | the jwt_t to get the value |
key | the key to retreive the value |
const char * r_jwt_get_sig_kid | ( | jwt_t * | jwt | ) |
Get private keys set for the signature
jwt | the jwt_t to get the value |
Get public keys set for the verification
jwt | the jwt_t to get the value |
int r_jwt_get_type | ( | jwt_t * | jwt | ) |
Get the type of JWT after a succesfull r_jwt_parse
jwt | the jwt_t to check |
int r_jwt_parse | ( | jwt_t * | jwt, |
const char * | token, | ||
int | x5u_flags | ||
) |
Parses a serialized JWT If the JWT is signed only, the claims will be available If the JWT is encrypted, the claims will not be accessible until r_jwt_decrypt or r_jwt_decrypt_verify_signature_nested is succesfull
jwt | the jwt that will contain the parsed token |
token | the token to parse into a JWT, 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_jwt_parse_unsecure | ( | jwt_t * | jwt, |
const char * | token, | ||
int | x5u_flags | ||
) |
Parses a serialized JWT Allows to parse unsigned JWT If the JWT is signed only, the claims will be available If the JWT is encrypted, the claims will not be accessible until r_jwt_decrypt or r_jwt_decrypt_verify_signature_nested is succesfull
jwt | the jwt that will contain the parsed token |
token | the token to parse into a JWT, 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_jwt_parsen | ( | jwt_t * | jwt, |
const char * | token, | ||
size_t | token_len, | ||
int | x5u_flags | ||
) |
Parses a serialized JWT If the JWT is signed only, the claims will be available If the JWT is encrypted, the claims will not be accessible until r_jwt_decrypt or r_jwt_decrypt_verify_signature_nested is succesfull
jwt | the jwt that will contain the parsed token |
token | the token to parse into a JWT |
token_len | token length |
x5u_flags | Flags to retrieve x5u certificates pointed by x5u if necessary, could be 0 if not needed Flags available are
|
int r_jwt_parsen_unsecure | ( | jwt_t * | jwt, |
const char * | token, | ||
size_t | token_len, | ||
int | x5u_flags | ||
) |
Parses a serialized JWT Allows to parse unsigned JWT If the JWT is signed only, the claims will be available If the JWT is encrypted, the claims will not be accessible until r_jwt_decrypt or r_jwt_decrypt_verify_signature_nested is succesfull
jwt | the jwt that will contain the parsed token |
token | the token to parse into a JWT |
token_len | token length |
x5u_flags | Flags to retrieve x5u certificates pointed by x5u if necessary, could be 0 if not needed Flags available are
|
jwt_t * r_jwt_quick_parse | ( | const char * | token, |
uint32_t | parse_flags, | ||
int | x5u_flags | ||
) |
Parses a serialized JWT If the JWT is signed only, the claims will be available If the JWT is encrypted, the claims will not be accessible until r_jwt_decrypt or r_jwt_decrypt_verify_signature_nested is succesfull
token | the token to parse into a JWT, must end with a NULL string terminator |
parse_flags | Flags to set or unset options Flags available are
|
x5u_flags | Flags to retrieve x5u certificates pointed by x5u if necessary, could be 0 if not needed Flags available are
|
jwt_t * r_jwt_quick_parsen | ( | const char * | token, |
size_t | token_len, | ||
uint32_t | parse_flags, | ||
int | x5u_flags | ||
) |
Parses a serialized JWT If the JWT is signed only, the claims will be available If the JWT is encrypted, the claims will not be accessible until r_jwt_decrypt or r_jwt_decrypt_verify_signature_nested is succesfull
token | the token to parse into a JWT |
token_len | token length |
parse_flags | Flags to set or unset options Flags available are
|
x5u_flags | Flags to retrieve x5u certificates pointed by x5u if necessary, could be 0 if not needed Flags available are
|
Return an encrypted JWT in serialized format (xxx.yyy.zzz.aaa.bbb)
jwt | the jwt_t to encrypt |
pubkey | the public key to encrypt the JWT, may be NULL |
x5u_flags | Flags to retrieve x5u certificates pointed by x5u if necessary, could be 0 if not needed Flags available are
|
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 | ||
) |
Return a nested JWT in serialized format A nested JWT can be signed, then encrypted, or encrypted, then signed
jwt | the jwt_t to serialize |
type | the nesting type Values available are
|
sign_key | the key to sign the JWT, may be NULL |
sign_key_x5u_flags | Flags to retrieve x5u certificates in sign_key pointed by x5u if necessary, could be 0 if not needed Flags available are
|
encrypt_key | the key to encrypt the JWT, may be NULL |
encrypt_key_x5u_flags | Flags to retrieve x5u certificates in encrypt_key pointed by x5u if necessary, could be 0 if not needed Flags available are
|
Return a signed JWT in serialized format (xxx.yyy.zzz)
jwt | the jwt_t to sign |
privkey | the private key to sign the JWT, may be NULL |
x5u_flags | Flags to retrieve x5u certificates pointed by x5u if necessary, could be 0 if not needed Flags available are
|
Return a signed JWT in serialized format (xxx.yyy.zzz) Allows to serialize unsigned JWT
jwt | the jwt_t to sign |
privkey | the private key to sign the JWT, may be NULL |
x5u_flags | Flags to retrieve x5u certificates pointed by x5u if necessary, could be 0 if not needed Flags available are
|
Adds an integer value to the JWT claim
jwt | the jwt_t to update |
key | the key to set to the JWT claim |
i_value | the value to set |
int r_jwt_set_claim_json_t_value | ( | jwt_t * | jwt, |
const char * | key, | ||
json_t * | j_value | ||
) |
Adds a JSON value to the JWT claim
jwt | the jwt_t to update |
key | the key to set to the JWT claim |
j_value | the value to set |
int r_jwt_set_claim_str_value | ( | jwt_t * | jwt, |
const char * | key, | ||
const char * | str_value | ||
) |
Adds a string value to the JWT claim
jwt | the jwt_t to update |
key | the key to set to the JWT claim |
str_value | the value to set |
int r_jwt_set_claims | ( | jwt_t * | jwt, |
... | |||
) |
Set the jwt claims with the list of claims given in parameters The list must end with the claim type R_JWT_CLAIM_NOP Claim types available
Set the JWT enc to use for payload encryption
jwt | the jwt_t |
enc | the encorithm to use for payload encryption |
Set the JWT alg to use for key encryption
jwt | the jwt_t |
alg | the algorithm to use for key encryption |
int r_jwt_set_enc_cypher_key | ( | jwt_t * | jwt, |
const unsigned char * | key, | ||
size_t | key_len | ||
) |
Sets the cypher key to encrypt or decrypt the payload
jwt | the jwt_t to update |
key | the key to encrypt or decrypt the payload |
key_len | the size of the key |
int r_jwt_set_enc_iv | ( | jwt_t * | jwt, |
const unsigned char * | iv, | ||
size_t | iv_len | ||
) |
Sets the Initialization Vector (iv)
jwt | the jwt_t to update |
iv | the iv to set |
iv_len | the size of the iv |
int r_jwt_set_full_claims_json_str | ( | jwt_t * | jwt, |
const char * | str_claims | ||
) |
Set the full JWT claim in JSON format delete all existing value
jwt | the jwt_t to get the value |
str_claims | the claim to set, must be JSON object in string format |
int r_jwt_set_full_claims_json_t | ( | jwt_t * | jwt, |
json_t * | j_claim | ||
) |
Set the full JWT claim in JSON format delete all existing value
jwt | the jwt_t to get the value |
j_claim | the claim to set, must be JSON object |
int r_jwt_set_full_header_json_str | ( | jwt_t * | jwt, |
const char * | str_header | ||
) |
Sets the entire header with the stringified JSON value specified
jwt | the jwt_t to update |
str_header | the header to set, must be a JSON object |
int r_jwt_set_full_header_json_t | ( | jwt_t * | jwt, |
json_t * | j_header | ||
) |
Sets the entire header with the JSON value specified
jwt | the jwt_t to update |
j_header | the header to set, must be a JSON object |
Adds an integer value to the JWT header
jwt | the jwt_t to update |
key | the key to set to the JWT header |
i_value | the value to set |
int r_jwt_set_header_json_t_value | ( | jwt_t * | jwt, |
const char * | key, | ||
json_t * | j_value | ||
) |
Adds a JSON value to the JWT header
jwt | the jwt_t to update |
key | the key to set to the JWT header |
j_value | the value to set |
int r_jwt_set_header_str_value | ( | jwt_t * | jwt, |
const char * | key, | ||
const char * | str_value | ||
) |
Adds a string value to the JWT header
jwt | the jwt_t to update |
key | the key to set to the JWT header |
str_value | the value to set |
int r_jwt_set_properties | ( | jwt_t * | jwt, |
... | |||
) |
Set the JWT alg to use for signature
jwt | the jwt_t to update |
alg | the algorithm to use for signature |
int r_jwt_token_type | ( | const char * | token | ) |
Guess the type of JWT based on the token format, but without parsing the token
token | the token to check |
int r_jwt_token_typen | ( | const char * | token, |
size_t | token_len | ||
) |
Guess the type of JWT based on the token format, but without parsing the token
token | the token to check |
token_len | token length |
int r_jwt_validate_claims | ( | jwt_t * | jwt, |
... | |||
) |
Validates the jwt claims with the list of expected claims given in parameters The list must end with the claim type R_JWT_CLAIM_NOP Claim types available
nbf
is before now: if (r_jwt_validate_claims(jwt, R_JWT_CLAIM_ISS, "https://example.com", R_JWT_CLAIM_SUB, "client_1", R_JWT_CLAIM_AUD, NULL, R_JWT_CLAIM_EXP, R_JWT_CLAIM_NOW, R_JWT_CLAIM_NBF, R_JWT_CLAIM_NOW, R_JWT_CLAIM_STR, "scope", "scope1", R_JWT_CLAIM_INT, "age", 42, R_JWT_CLAIM_JSN, "verified", json_true(), R_JWT_CLAIM_NOP) == RHN_OK) Verifies the signature of the JWT The JWT must contain a signature
jwt | the jwt_t to update |
pubkey | the public key to check the signature, can be NULL if jws already contains a public key |
x5u_flags | Flags to retrieve x5u certificates in pubkey pointed by x5u if necessary, could be 0 if not needed Flags available are
|
Verifies the signature of a nested JWT
jwt | the jwt_t to decrypt and verify signature |
verify_key | the public key to check the signature, can be NULL if jws already contains a public key |
verify_key_x5u_flags | Flags to retrieve x5u certificates in verify_key pointed by x5u if necessary, could be 0 if not needed Flags available are
|