trussed_core/
error.rs

1pub type Result<T, E = Error> = core::result::Result<T, E>;
2
3#[derive(Copy, Clone, Eq, PartialEq, Debug)]
4#[repr(u32)]
5#[non_exhaustive]
6pub enum Error {
7    // cryptoki errors
8    HostMemory = 0x0000_0002,
9    GeneralError = 0x0000_0005,
10    FunctionFailed = 0x0000_0006,
11    // supposed to support "stub" function for everything,
12    // returning this error
13    FunctionNotSupported = 0x0000_0054,
14    // unknown, or cannot be used in this token with selected function
15    MechanismInvalid = 0x0000_0070,
16    MechanismParamInvalid = 0x0000_0071,
17    ObjectHandleInvalid = 0x0000_0082,
18
19    // our errors
20    AeadError,
21    CborError,
22    ClientCountExceeded,
23    EntropyMalfunction,
24    FilesystemReadFailure,
25    FilesystemWriteFailure,
26    ImplementationError,
27    InternalError,
28    InvalidPath,
29    InvalidSerializedKey,
30    InvalidSerializedReply,
31    InvalidSerializedRequest,
32    InvalidSerializationFormat,
33    MechanismNotAvailable,
34    NonceOverflow,
35    NoSuchCertificate,
36    NoSuchKey,
37    NotJustLetters,
38    ReplySerializationFailure,
39    RequestNotAvailable,
40    SignDataTooLarge,
41    WrongKeyKind,
42    WrongMessageLength,
43    WrongSignatureLength,
44}