Goby3  3.1.5a
2024.05.23
jwt::error Namespace Reference

Everything related to error codes issued by the library. More...

Classes

struct  claim_not_present_exception
 
struct  ecdsa_exception
 
struct  invalid_json_exception
 
struct  rsa_exception
 
struct  signature_generation_exception
 
struct  signature_verification_exception
 
struct  token_verification_exception
 

Enumerations

enum  rsa_error {
  rsa_error::ok = 0, rsa_error::cert_load_failed = 10, rsa_error::get_key_failed, rsa_error::write_key_failed,
  rsa_error::write_cert_failed, rsa_error::convert_to_pem_failed, rsa_error::load_key_bio_write, rsa_error::load_key_bio_read,
  rsa_error::create_mem_bio_failed, rsa_error::no_key_provided
}
 Errors related to processing of RSA signatures. More...
 
enum  ecdsa_error {
  ecdsa_error::ok = 0, ecdsa_error::load_key_bio_write = 10, ecdsa_error::load_key_bio_read, ecdsa_error::create_mem_bio_failed,
  ecdsa_error::no_key_provided, ecdsa_error::invalid_key_size, ecdsa_error::invalid_key, ecdsa_error::create_context_failed
}
 Errors related to processing of RSA signatures. More...
 
enum  signature_verification_error {
  signature_verification_error::ok = 0, signature_verification_error::invalid_signature = 10, signature_verification_error::create_context_failed, signature_verification_error::verifyinit_failed,
  signature_verification_error::verifyupdate_failed, signature_verification_error::verifyfinal_failed, signature_verification_error::get_key_failed, signature_verification_error::set_rsa_pss_saltlen_failed,
  signature_verification_error::signature_encoding_failed
}
 Errors related to verification of signatures. More...
 
enum  signature_generation_error {
  signature_generation_error::ok = 0, signature_generation_error::hmac_failed = 10, signature_generation_error::create_context_failed, signature_generation_error::signinit_failed,
  signature_generation_error::signupdate_failed, signature_generation_error::signfinal_failed, signature_generation_error::ecdsa_do_sign_failed, signature_generation_error::digestinit_failed,
  signature_generation_error::digestupdate_failed, signature_generation_error::digestfinal_failed, signature_generation_error::rsa_padding_failed, signature_generation_error::rsa_private_encrypt_failed,
  signature_generation_error::get_key_failed, signature_generation_error::set_rsa_pss_saltlen_failed, signature_generation_error::signature_decoding_failed
}
 Errors related to signature generation errors. More...
 
enum  token_verification_error {
  token_verification_error::ok = 0, token_verification_error::wrong_algorithm = 10, token_verification_error::missing_claim, token_verification_error::claim_type_missmatch,
  token_verification_error::claim_value_missmatch, token_verification_error::token_expired, token_verification_error::audience_missmatch
}
 Errors related to token verification errors. More...
 

Functions

std::error_category & rsa_error_category ()
 Error category for RSA errors. More...
 
std::error_code make_error_code (rsa_error e)
 
std::error_category & ecdsa_error_category ()
 Error category for ECDSA errors. More...
 
std::error_code make_error_code (ecdsa_error e)
 
std::error_category & signature_verification_error_category ()
 Error category for verification errors. More...
 
std::error_code make_error_code (signature_verification_error e)
 
std::error_category & signature_generation_error_category ()
 Error category for signature generation errors. More...
 
std::error_code make_error_code (signature_generation_error e)
 
std::error_category & token_verification_error_category ()
 Error category for token verification errors. More...
 
std::error_code make_error_code (token_verification_error e)
 
void throw_if_error (std::error_code ec)
 

Detailed Description

Everything related to error codes issued by the library.

Enumeration Type Documentation

◆ ecdsa_error

Errors related to processing of RSA signatures.

Enumerator
ok 
load_key_bio_write 
load_key_bio_read 
create_mem_bio_failed 
no_key_provided 
invalid_key_size 
invalid_key 
create_context_failed 

Definition at line 161 of file jwt.h.

◆ rsa_error

enum jwt::error::rsa_error
strong

Errors related to processing of RSA signatures.

Enumerator
ok 
cert_load_failed 
get_key_failed 
write_key_failed 
write_cert_failed 
convert_to_pem_failed 
load_key_bio_write 
load_key_bio_read 
create_mem_bio_failed 
no_key_provided 

Definition at line 109 of file jwt.h.

◆ signature_generation_error

Errors related to signature generation errors.

Enumerator
ok 
hmac_failed 
create_context_failed 
signinit_failed 
signupdate_failed 
signfinal_failed 
ecdsa_do_sign_failed 
digestinit_failed 
digestupdate_failed 
digestfinal_failed 
rsa_padding_failed 
rsa_private_encrypt_failed 
get_key_failed 
set_rsa_pss_saltlen_failed 
signature_decoding_failed 

Definition at line 267 of file jwt.h.

◆ signature_verification_error

Errors related to verification of signatures.

Enumerator
ok 
invalid_signature 
create_context_failed 
verifyinit_failed 
verifyupdate_failed 
verifyfinal_failed 
get_key_failed 
set_rsa_pss_saltlen_failed 
signature_encoding_failed 

Definition at line 210 of file jwt.h.

◆ token_verification_error

Errors related to token verification errors.

Enumerator
ok 
wrong_algorithm 
missing_claim 
claim_type_missmatch 
claim_value_missmatch 
token_expired 
audience_missmatch 

Definition at line 342 of file jwt.h.

Function Documentation

◆ ecdsa_error_category()

std::error_category& jwt::error::ecdsa_error_category ( )
inline

Error category for ECDSA errors.

Definition at line 175 of file jwt.h.

◆ make_error_code() [1/5]

std::error_code jwt::error::make_error_code ( ecdsa_error  e)
inline

Definition at line 202 of file jwt.h.

◆ make_error_code() [2/5]

std::error_code jwt::error::make_error_code ( rsa_error  e)
inline

Definition at line 154 of file jwt.h.

◆ make_error_code() [3/5]

std::error_code jwt::error::make_error_code ( signature_generation_error  e)
inline

Definition at line 334 of file jwt.h.

◆ make_error_code() [4/5]

std::error_code jwt::error::make_error_code ( signature_verification_error  e)
inline

Definition at line 259 of file jwt.h.

◆ make_error_code() [5/5]

std::error_code jwt::error::make_error_code ( token_verification_error  e)
inline

Definition at line 384 of file jwt.h.

◆ rsa_error_category()

std::error_category& jwt::error::rsa_error_category ( )
inline

Error category for RSA errors.

Definition at line 125 of file jwt.h.

◆ signature_generation_error_category()

std::error_category& jwt::error::signature_generation_error_category ( )
inline

Error category for signature generation errors.

Definition at line 288 of file jwt.h.

◆ signature_verification_error_category()

std::error_category& jwt::error::signature_verification_error_category ( )
inline

Error category for verification errors.

Definition at line 225 of file jwt.h.

◆ throw_if_error()

void jwt::error::throw_if_error ( std::error_code  ec)
inline

Definition at line 389 of file jwt.h.

◆ token_verification_error_category()

std::error_category& jwt::error::token_verification_error_category ( )
inline

Error category for token verification errors.

Definition at line 355 of file jwt.h.