pub enum CommandError {
Show 14 variants WrongCrc, WrongSlot, SlotNotProgrammed, WrongPassword, NotAuthorized, Timestamp, NoName, NotSupported, UnknownCommand, AesDecryptionFailed, Unknown, InvalidString, InvalidSlot, RngError,
}
Expand description

Error types returned by Nitrokey device or by the library.

Variants

WrongCrc

A packet with a wrong checksum has been sent or received.

WrongSlot

A command tried to access an OTP slot that does not exist.

SlotNotProgrammed

A command tried to generate an OTP on a slot that is not configured.

WrongPassword

The provided password is wrong.

NotAuthorized

You are not authorized for this command or provided a wrong temporary password.

Timestamp

An error occured when getting or setting the time.

NoName

You did not provide a name for the OTP slot.

NotSupported

This command is not supported by this device.

UnknownCommand

This command is unknown.

AesDecryptionFailed

AES decryption failed.

Unknown

An unknown error occured.

InvalidString

You passed a string containing a null byte.

InvalidSlot

You passed an invalid slot.

RngError

An error occured during random number generation.

Trait Implementations

Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.