#[non_exhaustive]pub enum CryptoError {
Show 43 variants
Unavailable(Algorithm),
PolicyEmpty(Family),
PolicyDuplicate(Algorithm),
PolicyDrift,
PolicyVersionUnusable {
version: TlsVersion,
family: Family,
},
NotFips,
KeyGeneration(Algorithm),
Verify,
Sign,
Csr(CsrError),
Tls(TlsError),
Random,
AeadKey,
AeadSeal,
AeadOpen,
SealPlaintext,
SealDomainEmpty,
SealBlob,
SealVersion,
SealEphemeralKey,
SealPublicKey,
SealPrivateKey,
SealOpen,
Primitive,
#[non_exhaustive] EmptyProfile {
profile: Profile,
options: Options,
category: Family,
},
SignaturePrivateKey {
algorithm: SignatureAlgorithm,
},
SignaturePublicKey {
algorithm: SignatureAlgorithm,
},
KeyNotInProfile {
profile: Profile,
algorithm: SignatureAlgorithm,
},
NotApproved {
algorithm: Algorithm,
approval: Approval,
},
NotInProfile {
profile: Profile,
algorithm: Algorithm,
},
MacKeyLength {
profile: Profile,
bytes: usize,
min_bits: usize,
max_bits: usize,
},
MacVerify,
KdfOutputLength {
algorithm: KdfAlgorithm,
bytes: usize,
max_bytes: usize,
},
KdfSecretEmpty,
KdfInfoEmpty {
profile: Profile,
},
KdfInfoMayBeEmpty {
profile: Profile,
},
KdfSpecMismatch {
algorithm: KdfAlgorithm,
},
KeyAgreementPeerKey {
algorithm: KeyAgreementAlgorithm,
},
KeyAgreementPrivateKey {
algorithm: KeyAgreementAlgorithm,
},
AeadKeyLength {
algorithm: AeadAlgorithm,
bytes: usize,
},
AeadPlaintextLength {
algorithm: AeadAlgorithm,
bytes: usize,
},
AeadLimit {
algorithm: AeadAlgorithm,
},
FamilyNotAdmitted(Family),
}Expand description
A refusal from one of the crate’s operations. It never carries key or plaintext material.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
The algorithm is not available on this backend’s module.
PolicyEmpty(Family)
A TLS policy names nothing in this family.
PolicyDuplicate(Algorithm)
A TLS policy names this algorithm more than once.
PolicyDrift
A provider does not carry exactly a policy’s algorithms.
PolicyVersionUnusable
A TLS policy lists a version but names nothing in this family usable with it.
Fields
version: TlsVersionThe listed version.
NotFips
The process is not running the AWS-LC FIPS module, or a provider is not FIPS.
KeyGeneration(Algorithm)
Key generation failed.
Verify
A signature did not verify.
Sign
Signing failed.
Csr(CsrError)
A certificate signing request could not be produced.
Tls(TlsError)
A TLS configuration step was refused.
Random
The random generator failed.
AeadKey
The AEAD key was refused.
AeadSeal
AEAD sealing failed.
AeadOpen
The AEAD ciphertext did not authenticate.
SealPlaintext
A sealed-box plaintext is empty.
SealDomainEmpty
A sealed-box domain is empty. The domain is the HKDF salt, and the module does not mark an HKDF call with an empty salt approved.
SealBlob
A sealed blob is shorter than a header, one byte and a tag.
SealVersion
A sealed blob carries an unknown version.
SealEphemeralKey
A sealed blob’s ephemeral key is not an uncompressed P-384 point.
SealPublicKey
A sealing public key is not a canonical P-384 SubjectPublicKeyInfo.
SealPrivateKey
A sealing private key is not a P-384 PKCS#8 key.
SealOpen
A sealed blob does not open under this key, domain and AAD.
Primitive
A cryptographic primitive failed.
#[non_exhaustive]EmptyProfile
A profile, narrowed by its options, names nothing in a family.
Fields
This variant is marked as non-exhaustive
SignaturePrivateKey
A signature private key that cannot be imported: its PKCS#8 structure is not the one its RFCs define for the algorithm, or the module refuses it.
Fields
algorithm: SignatureAlgorithmThe signature algorithm.
SignaturePublicKey
A public key that is not the raw key of the signature algorithm’s shape, such as a SubjectPublicKeyInfo or a compressed point.
Fields
algorithm: SignatureAlgorithmThe signature algorithm.
KeyNotInProfile
A key algorithm the profile does not admit.
NotApproved
An algorithm the running module does not approve.
NotInProfile
An algorithm, outside TLS, the profile does not admit.
MacKeyLength
An HMAC key whose length is outside the profile’s range.
Fields
MacVerify
A MAC did not verify.
KdfOutputLength
A KDF output length outside 1 to the KDF’s max_output_len().
Fields
algorithm: KdfAlgorithmThe KDF.
KdfSecretEmpty
An empty KDF secret.
KdfInfoEmpty
An empty KDF info under a profile that refuses one.
KdfInfoMayBeEmpty
A profile that admits an empty KDF info, which the module does not approve; refused by
assert_admitted_approved when the caller names Family::Kdf and the profile admits any
KDF.
KdfSpecMismatch
A KDF specification whose variant does not match its algorithm.
Fields
algorithm: KdfAlgorithmThe algorithm the specification carries.
KeyAgreementPeerKey
A peer public key that is malformed for the curve, or that the module’s validation refused.
Fields
algorithm: KeyAgreementAlgorithmThe key-agreement algorithm.
KeyAgreementPrivateKey
A static key-agreement private key that cannot be imported.
Fields
algorithm: KeyAgreementAlgorithmThe key-agreement algorithm.
AeadKeyLength
An AEAD key whose length is not the algorithm’s key_len().
AeadPlaintextLength
A plaintext longer than the AEAD algorithm’s max_plaintext_len().
AeadLimit
An AEAD key that has sealed 2^32 times (SP 800-38D §8.3); a new key is needed.
Fields
algorithm: AeadAlgorithmThe AEAD algorithm.
FamilyNotAdmitted(Family)
A family assert_admitted_approved does not check: a TLS family, which
assert_module_approves checks, or one this backend does not walk.
Trait Implementations§
Source§impl Clone for CryptoError
impl Clone for CryptoError
impl Copy for CryptoError
Source§impl Debug for CryptoError
impl Debug for CryptoError
Source§impl Display for CryptoError
impl Display for CryptoError
impl Eq for CryptoError
Source§impl Error for CryptoError
impl Error for CryptoError
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()