pub struct Package {
pub version: u32,
pub expires_at: u64,
/* private fields */
}Expand description
The on-the-wire package: a cleartext header + the age-sealed payload bytes.
The sealed bytes are an age ciphertext of the JSON-serialized
PackagePayload; only the recipient’s ed25519 private key opens them. The
header (magic, version, expires_at) is cleartext so a reader can reject an
expired or foreign package without the recipient key.
Fields§
§version: u32Schema version.
expires_at: u64Expiry (Unix seconds), mirrored from the sealed payload.
Implementations§
Source§impl Package
impl Package
Sourcepub fn fingerprint(&self) -> String
pub fn fingerprint(&self) -> String
The package fingerprint: a full BLAKE3 hex of the sealed ciphertext. Used
to bind an AccessToken to exactly this package. The input is
ciphertext, not a value, so the full hash is safe to surface (I12).
Sourcepub fn to_bytes(&self) -> Vec<u8> ⓘ
pub fn to_bytes(&self) -> Vec<u8> ⓘ
Serialize to the on-disk frame: magic + version + expires_at + sealed.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, CoreError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, CoreError>
Parse an on-disk frame back into a package, validating the header. Does
not decrypt — that needs the recipient identity (see open_attended).