pub struct Passport {
pub version: u32,
pub object_id: String,
pub key_fingerprint: String,
pub scope_summary: String,
pub valid_from: DateTime<Utc>,
pub valid_until: DateTime<Utc>,
}Expand description
A machine-readable passport: a compact, deterministic summary of a certificate or artifact, verifiable against the same anchor bundle and transparency log as the underlying object.
Fields§
§version: u32Passport format version.
object_id: StringThe certificate or artifact identifier.
key_fingerprint: StringKey fingerprint of the identified object.
scope_summary: StringHuman- and machine-readable scope summary.
valid_from: DateTime<Utc>Passport validity period start.
valid_until: DateTime<Utc>Passport validity period end.
Implementations§
Source§impl Passport
impl Passport
Sourcepub fn distribution_bytes(&self) -> SignatifResult<Vec<u8>>
pub fn distribution_bytes(&self) -> SignatifResult<Vec<u8>>
Deterministic distribution bytes (JCS) — the barcode payload base for 2D delivery.
§Errors
Propagates canonicalization errors.
Sourcepub fn is_valid_at(&self, now: DateTime<Utc>) -> bool
pub fn is_valid_at(&self, now: DateTime<Utc>) -> bool
Whether the passport is valid at now.
Sourcepub fn from_distribution_bytes(bytes: &[u8]) -> SignatifResult<Self>
pub fn from_distribution_bytes(bytes: &[u8]) -> SignatifResult<Self>
Parse a passport from its deterministic bytes.
§Errors
Returns an encoding error on malformed input.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Passport
impl<'de> Deserialize<'de> for Passport
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Passport
impl RefUnwindSafe for Passport
impl Send for Passport
impl Sync for Passport
impl Unpin for Passport
impl UnsafeUnpin for Passport
impl UnwindSafe for Passport
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