#[non_exhaustive]pub enum TpmCryptoError {
Show 23 variants
BufferTooSmall {
expected: usize,
actual: usize,
},
Crypto(ErrorStack),
InvalidEccCurve(TpmEccCurve),
InvalidEccNid(Nid),
InvalidEccPoint {
curve: TpmEccCurve,
x_len: usize,
y_len: usize,
expected_len: usize,
},
InvalidEccKey,
InvalidEccGroupDegree(u32),
InvalidHash,
InvalidMessageDigestNid(Nid),
InvalidKeyBits(u16),
InvalidKdfKeyBits(usize),
InvalidObjectType,
InvalidPublicArea {
object_type: TpmAlgId,
field: TpmPublicAreaField,
},
InvalidRsaKey,
InvalidRsaModulus(Vec<u8>),
InvalidRsaExponent(TpmUint32),
InvalidPrivateKeySize {
len: usize,
max: usize,
},
MissingRsaPrivatePrime,
InvalidRandomRange,
KeyIsEmpty,
Marshal(TpmError),
MacMismatch,
Unmarshal(TpmError),
}Expand description
The top-level error type for cryptographic operations.
Display renders only the variant name as lowercase space-separated words
(e.g. BufferTooSmall becomes buffer too small).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
BufferTooSmall
The output buffer is too small for the requested operation.
Crypto(ErrorStack)
A libcrypto operation failed.
InvalidEccCurve(TpmEccCurve)
ECC curve is not supported in the context of use.
InvalidEccNid(Nid)
OpenSSL ECC NID is not supported in the context of use.
InvalidEccPoint
Invalid ECC point shape.
Fields
curve: TpmEccCurveTPM ECC curve associated with the point.
InvalidEccKey
Invalid ECC key structure.
InvalidEccGroupDegree(u32)
Invalid ECC group degree.
InvalidHash
Hash algorithm is not supported in the context of use.
InvalidMessageDigestNid(Nid)
OpenSSL message digest NID is not supported in the context of use.
InvalidKeyBits(u16)
Invalid RSA key bits.
InvalidKdfKeyBits(usize)
Invalid KDF key bits.
InvalidObjectType
Invalid object type.
InvalidPublicArea
Invalid public area.
Fields
field: TpmPublicAreaFieldField that failed validation.
InvalidRsaKey
Invalid RSA key structure.
InvalidRsaModulus(Vec<u8>)
Invalid RSA public modulus.
InvalidRsaExponent(TpmUint32)
Invalid RSA public exponent.
InvalidPrivateKeySize
Invalid private key size.
Fields
MissingRsaPrivatePrime
RSA private prime is missing.
InvalidRandomRange
A random sampling range is empty or inverted.
KeyIsEmpty
A zero-length key was provided.
Marshal(TpmError)
Marshaling a TPM protocol encoded object failed.
MacMismatch
The computed message authentication code does not match the expected value.
Unmarshal(TpmError)
Unmarshaling a TPM protocol encoded object failed.
Trait Implementations§
Source§impl AsRef<str> for TpmCryptoError
impl AsRef<str> for TpmCryptoError
Source§impl Debug for TpmCryptoError
impl Debug for TpmCryptoError
Source§impl Display for TpmCryptoError
impl Display for TpmCryptoError
impl Eq for TpmCryptoError
Source§impl Error for TpmCryptoError
impl Error for TpmCryptoError
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()