This group contains interfaces for error handling mechanism that is used in the library.
More...
|
enum | virgil::crypto::VirgilCryptoError {
virgil::crypto::VirgilCryptoError::Reserved = 0,
virgil::crypto::VirgilCryptoError::EmptyParameter,
virgil::crypto::VirgilCryptoError::ExceededMaxSize,
virgil::crypto::VirgilCryptoError::InvalidArgument,
virgil::crypto::VirgilCryptoError::InvalidFormat,
virgil::crypto::VirgilCryptoError::InvalidPrivateKey,
virgil::crypto::VirgilCryptoError::InvalidPrivateKeyPassword,
virgil::crypto::VirgilCryptoError::InvalidPublicKey,
virgil::crypto::VirgilCryptoError::InvalidSignature,
virgil::crypto::VirgilCryptoError::InvalidState,
virgil::crypto::VirgilCryptoError::InvalidAuth,
virgil::crypto::VirgilCryptoError::MismatchSignature,
virgil::crypto::VirgilCryptoError::NotFoundKeyRecipient,
virgil::crypto::VirgilCryptoError::NotFoundPasswordRecipient,
virgil::crypto::VirgilCryptoError::NotInitialized,
virgil::crypto::VirgilCryptoError::NotSecure,
virgil::crypto::VirgilCryptoError::UnsupportedAlgorithm,
Undefined = std::numeric_limits<int>::max()
} |
| Specific error codes for the crypto library. More...
|
|
This group contains interfaces for error handling mechanism that is used in the library.
Specific error codes for the crypto library.
Enumerator |
---|
Reserved |
Should not be used.
|
EmptyParameter |
Given parameter is null or empty.
|
ExceededMaxSize |
Structure maximum size was exceeded.
|
InvalidArgument |
Argument given to a function is invalid.
|
InvalidFormat |
Data format is invalid.
|
InvalidPrivateKey |
Invalid format of the Private Key.
|
InvalidPrivateKeyPassword |
Private Key password mismatch.
|
InvalidPublicKey |
Invalid format of the Public Key.
|
InvalidSignature |
Invalid format of the Signature.
|
InvalidState |
Function call prerequisite is broken.
|
InvalidAuth |
Invalid authentication.
|
MismatchSignature |
Signature validation failed.
|
NotFoundKeyRecipient |
Recipient with given identifier is not found.
|
NotFoundPasswordRecipient |
Recipient with given password is not found.
|
NotInitialized |
Object is not initialized with specific algorithm, so can't be used.
|
NotSecure |
Security prerequisite is broken.
|
UnsupportedAlgorithm |
Algorithm is not supported in the current build.
|
const VirgilCryptoErrorCategory& virgil::crypto::crypto_category |
( |
| ) |
|
|
noexcept |
Return singleton instance of the crypto error category.
- Returns
- Instance of the crypto error categoty.
Build exception with given error value and corresond error category.
- Parameters
-
- Returns
- Exception with given error value and corresond error category.
- See also
- VirgilCryptoError for specific Error values.
VirgilCryptoException virgil::crypto::make_error |
( |
VirgilCryptoError |
ev, |
|
|
const std::string & |
what |
|
) |
| |
|
inline |
Build exception with given error value and corresond error category.
- Parameters
-
ev | Error value. |
what | Additional error description. |
- Returns
- Exception with given error value and corresond error category.
- See also
- VirgilCryptoError for specific Error values.
VirgilCryptoException virgil::crypto::make_error |
( |
VirgilCryptoError |
ev, |
|
|
const char * |
what |
|
) |
| |
|
inline |
Build exception with given error value and corresond error category.
- Parameters
-
ev | Error value. |
what | Additional error description. |
- Returns
- Exception with given error value and corresond error category.
- See also
- VirgilCryptoError for specific Error values.
const VirgilSystemCryptoErrorCategory& virgil::crypto::foundation::system_crypto_category |
( |
| ) |
|
|
noexcept |
Return singleton instance of the system crypto error category.
- Returns
- Instance of the syste, crypto error categoty.
void virgil::crypto::foundation::system_crypto_handler |
( |
int |
result | ) |
|
|
inline |
Handle value returned by underling system crypto library.
If given value is an error then VirgilCryptoException will be thrown with appropriate description. If given value is not an error then do nothing.
- Parameters
-
result | Value returned by system crypto library. |
- Exceptions
-
template<typename CatchHandler >
void virgil::crypto::foundation::system_crypto_handler |
( |
int |
result, |
|
|
CatchHandler |
catch_handler |
|
) |
| |
|
inline |
Handle value returned by underling system crypto library.
This function is usefull if thrown exception SHOULD be wrapped or error can be handled in a different way. Initial exception can be accessed via std::current_exception(), or std::throw_with_nested().
If given value is an error then VirgilCryptoException will be thrown with appropriate description. If given value is not an error then do nothing.
- Parameters
-
result | Value returned by system crypto library. |
catch_handler | Function that can handle the error in a different way. |
int virgil::crypto::foundation::system_crypto_handler_get_result |
( |
int |
result | ) |
|
|
inline |
Handle value returned by underling system crypto library.
If given value is an error then VirgilCryptoException will be thrown with appropriate description. If given value is not an error then it will be returned.
- Parameters
-
result | Value returned by system crypto library. |
- Returns
- Value if it's not an error.
- Exceptions
-
template<typename CatchHandler >
int virgil::crypto::foundation::system_crypto_handler_get_result |
( |
int |
result, |
|
|
CatchHandler |
catch_handler |
|
) |
| |
|
inline |
Handle value returned by underling system crypto library.
This function is usefull if thrown exception SHOULD be wrapped. Initial exception can be accessed via std::current_exception(), or std::throw_with_nested().
If given value is an error then VirgilCryptoException will be thrown with appropriate description. If given value is not an error then it will be returned.
- Parameters
-
result | Value returned by system crypto library. |
catch_handler | Function that can handle the error in a different way. |
- Returns
- Value if it's not an error.