#[non_exhaustive]pub struct DecodeResult {
pub claim169: Claim169,
pub cwt_meta: CwtMeta,
pub verification_status: VerificationStatus,
pub x509_headers: X509Headers,
pub detected_compression: DetectedCompression,
pub warnings: Vec<Warning>,
pub key_id: Option<Vec<u8>>,
pub algorithm: Option<Algorithm>,
}Expand description
Result of successfully decoding a Claim 169 QR code.
This struct contains all the data extracted from the QR code:
- The identity data (
Claim169) - CWT metadata like issuer and expiration (
CwtMeta) - The signature verification status
- Any warnings generated during decoding
§Example
let result = Decoder::new(qr_content)
.verify_with_ed25519(&public_key)?
.decode()?;
// Access identity data
if let Some(name) = &result.claim169.full_name {
println!("Welcome, {}!", name);
}
// Check verification status
match result.verification_status {
VerificationStatus::Verified => println!("Signature verified"),
VerificationStatus::Skipped => println!("Verification skipped"),
VerificationStatus::Failed => println!("Verification failed"),
}
// Check for warnings
for warning in &result.warnings {
println!("Warning: {}", warning.message);
}Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.claim169: Claim169The extracted Claim 169 identity data.
Contains demographic information (name, date of birth, address, etc.) and optionally biometric data (fingerprints, iris scans, face images).
cwt_meta: CwtMetaCWT (CBOR Web Token) metadata.
Contains standard claims like issuer, subject, expiration time, and issued-at timestamp.
verification_status: VerificationStatusSignature verification status.
Verified: Signature was checked and is validSkipped: No verifier was provided (only ifallow_unverifiedwas set)Failed: Signature verification failed (this typically returns an error instead)
x509_headers: X509HeadersX.509 certificate headers from the COSE structure.
Contains any X.509 certificate information present in the COSE protected/unprotected headers (x5bag, x5chain, x5t, x5u).
detected_compression: DetectedCompressionThe compression format detected during decoding.
Indicates which compression format was auto-detected and used:
Zlib (spec-compliant), Brotli (non-standard), or None (raw).
warnings: Vec<Warning>Warnings generated during decoding.
Non-fatal issues that don’t prevent decoding but may warrant attention, such as unknown fields (forward compatibility) or skipped validations.
key_id: Option<Vec<u8>>Key ID from the COSE protected header, if present.
Useful for identifying which key was used for signing in multi-issuer or key-rotation scenarios.
algorithm: Option<Algorithm>COSE algorithm used for signing or encryption.
Reflects the algorithm declared in the COSE protected header (e.g., EdDSA, ES256).