Skip to main content

PackagePayload

Struct PackagePayload 

Source
pub struct PackagePayload {
    pub schema_version: u32,
    pub environment: String,
    pub created: String,
    pub expires_at: u64,
    pub token_commitment: String,
    pub entries: Vec<SecretRecord>,
}
Expand description

The plaintext that gets sealed into a Package.

Debug is safe: the only secret-bearing material lives inside the entries (a literal’s value, a keypair’s private, a totp’s seed), all SecretValues whose Debug is redacted (I12). The token_commitment is a BLAKE3 hash of the token secret — not the secret itself.

Fields§

§schema_version: u32

Schema version of this payload.

§environment: String

The environment scope the package was cut for (e.g. dev). All entries share it; never prod (I4a).

§created: String

RFC-3339 creation timestamp (provenance metadata, not a secret).

§expires_at: u64

Expiry as Unix seconds. Mirrored in the cleartext Package header so a reader can reject an expired package before attempting decryption.

§token_commitment: String

BLAKE3(token_secret) — the commitment an unattended open checks the presented token secret against (factor 2). Set by seal.

§entries: Vec<SecretRecord>

The packaged records, each in its stored modality. Literals carry their value; references carry only the pointer URI (I8); keypair/totp carry their sealed private half / seed.

Implementations§

Source§

impl PackagePayload

Source

pub fn new( environment: impl Into<String>, created: impl Into<String>, expires_at: u64, entries: Vec<SecretRecord>, ) -> Self

Build a payload for environment, expiring at expires_at (Unix secs), over entries. token_commitment is left empty; seal fills it.

Trait Implementations§

Source§

impl Debug for PackagePayload

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for PackagePayload

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for PackagePayload

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V