#[non_exhaustive]pub enum ScllError {
Show 38 variants
TransportUnavailable,
CardRemoved,
ReaderGone,
Timeout,
ScpProtocolUnsupported,
NoCommonSecurityLevel,
KvnMismatch,
CardCryptogramFail,
CardChallengeFail,
ExternalAuthFail {
sw: u16,
},
SecurityStatusNotSatisfied,
NoOpenChannel,
KeyNotFound,
KeyTypeUnsupported {
offered: u8,
supported: Vec<u8, MAX_KEYTYPE_SUPPORTED>,
},
KeyCheckValueMismatch,
CannotDeleteActiveKeyset,
InvalidAid {
len: usize,
},
AidAlreadyExists,
PackageAidExists,
PackageNotFound,
ResidentSdNotFound,
LoadTooLarge,
SsdHasApplets,
ElfHasOtherInstances,
CardNotUsable,
IllegalLifecycleTransition,
ConditionsNotSatisfied,
IsdAidNotFound,
SessionNotIsd,
TargetNoLongerExists,
TerminateOutOfScope,
ParentLacksAm,
UnsupportedPrivilege,
Card {
sw: u16,
},
MalformedResponse(TlvError),
Build(BuildError),
Cap(CapError),
Backend(BackendError),
}Expand description
Fatal error returned by every public workflow function (Result<XReport, ScllError>).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
CardRemoved
ReaderGone
Timeout
ScpProtocolUnsupported
NoCommonSecurityLevel
KvnMismatch
CardCryptogramFail
CardChallengeFail
ExternalAuthFail
SecurityStatusNotSatisfied
NoOpenChannel
KeyNotFound
KeyTypeUnsupported
KeyCheckValueMismatch
CannotDeleteActiveKeyset
InvalidAid
AidAlreadyExists
PackageAidExists
PackageNotFound
ResidentSdNotFound
LoadTooLarge
SsdHasApplets
ElfHasOtherInstances
CardNotUsable
IllegalLifecycleTransition
ConditionsNotSatisfied
IsdAidNotFound
SessionNotIsd
TargetNoLongerExists
TerminateOutOfScope
ParentLacksAm
UnsupportedPrivilege
Card
MalformedResponse(TlvError)
Build(BuildError)
Cap(CapError)
Backend(BackendError)
Implementations§
Source§impl ScllError
impl ScllError
Sourcepub fn from_general_sw(sw: u16) -> ScllError
pub fn from_general_sw(sw: u16) -> ScllError
Map a context-free command status word to its ScllError.
This covers only the general error conditions of GPCS v2.3.1
Table 11-10 — the two status words whose meaning is invariant across
every GP command (6982 security status, 6985 conditions of use).
Everything else falls through to the ScllError::Card catch-all, so
the mapping is total: every u16 yields exactly one variant.
Per-command refinements are deliberately not decided here. The same
SW means different things per command — e.g. 6985 is
IllegalLifecycleTransition for SET STATUS (Table 11-87) but
ElfHasOtherInstances for DELETE (Table 11-26); 6A88 is
IsdAidNotFound, KeyNotFound, or PackageNotFound by context. Those
live in the workflow layer, which inspects the SW before delegating the
residue to this general mapper (PDD §8 status-word coverage).
Note: 9000 (success) is not an error; callers check for success before
calling this. Passing it returns Card { sw: 0x9000 } (harmless).
Trait Implementations§
Source§impl Error for ScllError
impl Error for ScllError
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()