#[non_exhaustive]pub enum ProviderError {
KeyNotExportable,
External(ExternalProviderError),
Unsupported {
operation: ProviderOperation,
algorithm: Option<String>,
},
InvalidKeySize {
expected: usize,
actual: usize,
},
InvalidOutputSize {
operation: ProviderOperation,
expected: usize,
actual: usize,
},
InvalidOutputSizeRange {
operation: ProviderOperation,
minimum: usize,
maximum: usize,
actual: usize,
},
InvalidInput(ProviderInputError),
AuthenticationFailed,
Random(String),
}Expand description
Failure returned by a cryptographic provider.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
KeyNotExportable
A secret-bearing external handle cannot be exported as bytes.
External(ExternalProviderError)
Redacted external-provider failure: never includes credentials or selectors.
Unsupported
The selected provider does not implement the operation/parameters.
Fields
operation: ProviderOperationRequested operation.
InvalidKeySize
A key has the wrong size for the selected algorithm.
InvalidOutputSize
A provider reported success but returned bytes that violate the selected operation’s fixed-size output contract.
Fields
operation: ProviderOperationOperation whose output contract was violated.
InvalidOutputSizeRange
A provider reported success but returned bytes outside the selected operation’s variable-size output contract.
Fields
operation: ProviderOperationOperation whose output contract was violated.
InvalidInput(ProviderInputError)
Input framing, padding, or primitive initialization is invalid.
AuthenticationFailed
Authenticated decryption or key-wrap integrity validation failed.
Random(String)
Operating-system randomness was unavailable.
Trait Implementations§
Source§impl Clone for ProviderError
impl Clone for ProviderError
Source§impl Debug for ProviderError
impl Debug for ProviderError
Source§impl Display for ProviderError
impl Display for ProviderError
impl Eq for ProviderError
Source§impl Error for ProviderError
impl Error for ProviderError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()