pub enum VerifyError {
Show 21 variants
InvalidJwsShape(usize),
Base64Decode {
segment: &'static str,
source: DecodeError,
},
InvalidJwsHeader,
PayloadJson(Error),
AudienceMismatch {
expected: String,
actual: String,
},
NonceMismatch,
Expired {
exp: u64,
now: u64,
},
NotYetValid {
iat: u64,
now: u64,
max_skew_secs: u64,
},
MalformedDid {
did: String,
},
MalformedVmPubkey {
vm_id: String,
},
SignatureWrongLength {
actual: usize,
},
SignatureInvalidScalars,
GenesisSignatureInvalid,
ChainSignerNotInPriorRoster {
entry_version: u64,
signer_kid: String,
},
ChainSignatureInvalid {
entry_version: u64,
},
ChainVersionNotMonotonic {
entry_version: u64,
prior_version: u64,
},
CurrentVmNotInHeadRoster {
vm_id: String,
},
JwtSignatureInvalid,
RollbackDetected {
current: u64,
last_seen: u64,
},
ForkDetected {
version: u64,
},
ChainEntryDidMismatch {
entry_version: u64,
entry_did: String,
},
}Expand description
The single error type returned by crate::verify_mid_response.
Variants§
InvalidJwsShape(usize)
The JWT string did not have exactly 3 dot-separated segments.
Base64Decode
One of the base64url segments failed to decode.
Fields
source: DecodeErrorThe underlying base64 error.
InvalidJwsHeader
The JWS header was not valid JSON or did not declare alg: ES256.
PayloadJson(Error)
The JWT payload JSON was not parseable into a mid_issuer::MidJwtPayload.
AudienceMismatch
The aud claim did not match the verifier’s expected audience.
NonceMismatch
The nonce claim did not match the nonce the RP issued for this
session — possible replay attempt or stale tab.
Expired
The JWT’s exp is in the past relative to the verifier’s clock.
NotYetValid
The JWT’s iat is too far in the future for the verifier’s clock
skew tolerance — possible attacker producing forward-dated tokens
or genuine clock skew.
Fields
MalformedDid
The DID’s base58 suffix did not decode to a valid P-256 public key. Either the DID is malformed or it’s from a non-mID identity system.
MalformedVmPubkey
A verification method’s publicKeyMultibase did not decode to a
valid P-256 public key.
SignatureWrongLength
A base64url-encoded signature was not 64 bytes (the expected
r || s form for ES256).
SignatureInvalidScalars
The signature was 64 bytes but r/s are not valid P-256 scalars
(zero, >= curve order). Often means the wallet returned a placeholder
all-zero signature (vault locked / sign failed).
GenesisSignatureInvalid
The genesis roster’s self-signature did not verify against the key recoverable from the DID. Either the genesis roster was tampered with or the signature is from a different key — the user does not hold the genesis key.
ChainSignerNotInPriorRoster
A roster chain entry was signed by a verification method that is not present in the prior entry’s roster — the chain is broken.
Fields
ChainSignatureInvalid
A roster chain entry’s signature did not verify against the claimed signer’s public key. Either the entry was tampered with or the signature is from a different key.
ChainVersionNotMonotonic
Chain versions did not strictly increase. Indicates a stolen device trying to bundle an older roster envelope as the head, or a malformed chain.
Fields
CurrentVmNotInHeadRoster
The verification method that signed the JWT is not present in the head roster — the signing device has been revoked.
JwtSignatureInvalid
The JWS outer signature did not verify against the embedded verification method’s public key.
RollbackDetected
The current roster version is less than the highest the RP has seen for this DID — possible stolen-device replay of an old (pre-revocation) roster envelope.
This variant is NEVER produced by crate::verify_mid_response
directly; the RP uses crate::VerifiedMid::check_rollback after
looking up last_seen_version from its own per-DID store.
Fields
ForkDetected
The token’s roster history does not contain the exact roster the RP saw
last at version: another history was branched off an older roster.
Returned by crate::VerifiedMid::check_continuity. A device removed at
some version, but listed in an earlier one, can sign its own later
versions from that earlier roster; only the content of the version the RP
already saw tells the two histories apart.
ChainEntryDidMismatch
A roster chain entry names a different DID than the token’s issuer.
Trait Implementations§
Source§impl Debug for VerifyError
impl Debug for VerifyError
Source§impl Display for VerifyError
impl Display for VerifyError
Source§impl Error for VerifyError
impl Error for VerifyError
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()