#[non_exhaustive]pub struct InspectResult {
pub issuer: Option<String>,
pub subject: Option<String>,
pub key_id: Option<Vec<u8>>,
pub algorithm: Option<Algorithm>,
pub x509_headers: X509Headers,
pub expires_at: Option<i64>,
pub cose_type: CoseType,
}Expand description
Metadata extracted from a credential without full verification or decoding.
Useful for determining which key to use before calling Decoder::decode().
This allows verifiers in multi-issuer scenarios to:
- Inspect the credential to find the issuer and key ID
- Look up the correct verification key
- Perform full decoding with the appropriate key
§Example
ⓘ
use claim169_core::inspect;
let info = inspect(qr_text)?;
println!("Issuer: {:?}, Key ID: {:?}", info.issuer, info.key_id);
// Use the metadata to select the right verification key
let public_key = key_store.get(&info.issuer, &info.key_id);
let result = Decoder::new(qr_text)
.verify_with_ed25519(&public_key)?
.decode()?;Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.issuer: Option<String>Issuer from CWT claims (claim key 1).
subject: Option<String>Subject from CWT claims (claim key 2).
key_id: Option<Vec<u8>>Key ID from the COSE header.
algorithm: Option<Algorithm>COSE algorithm declared in the protected header.
x509_headers: X509HeadersX.509 certificate headers from the COSE structure.
expires_at: Option<i64>Expiration time from CWT claims (Unix epoch seconds).
cose_type: CoseTypeCOSE structure type (Sign1 or Encrypt0).
Trait Implementations§
Source§impl Clone for InspectResult
impl Clone for InspectResult
Source§fn clone(&self) -> InspectResult
fn clone(&self) -> InspectResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for InspectResult
impl RefUnwindSafe for InspectResult
impl Send for InspectResult
impl Sync for InspectResult
impl Unpin for InspectResult
impl UnsafeUnpin for InspectResult
impl UnwindSafe for InspectResult
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more