use super::StatusCode;
#[derive(Debug, thiserror::Error)]
pub enum Error<IoBackendErrorT> {
#[error("IO Backend returned an error")]
IoBackend(IoBackendErrorT),
#[error("DESFire Card replied with a bad or unexpected StatusCode ({0:?})")]
BadStatusCode(StatusCode),
#[error("The amount of data returned by the DESFire Card was wrong or unexpected.")]
BadSize,
#[error("Key ID is out of bounds")]
BadKeyId,
#[error("Invalid Authentication challenge response")]
InvalidHandshakeResponse,
#[error("Invalid CMAC signature")]
InvalidSignature,
#[error("Invalid crc32 checksum")]
InvalidCrc32,
#[error("Unsupported cryptographic algorithm")]
UnsupportedAlgorithm,
#[error("Unsupported file type")]
UnsupportedFileType,
#[error("Bad file communication type; authentication needed")]
BadFileCommunication,
#[error("Bad cryptographic algorithm combination")]
BadAlgorithm,
#[error("Unsupported file communication")]
UnsupportedFileCommunication,
#[error("Command assumes that we're in an application, but we're not")]
NoSelectedApplication,
#[error("incomplete read of a file")]
PartialRead,
#[error("Could not get random data")]
Getrandom(getrandom::Error),
}