pub struct Payload { /* private fields */ }Expand description
Strongly typed wilder.pser/0.5 payload.
Implementations§
Source§impl Payload
impl Payload
Sourcepub fn from_json(bytes: &[u8]) -> Result<Self>
pub fn from_json(bytes: &[u8]) -> Result<Self>
Parses JSON and validates every profile rule, including chain.hash.
§Errors
Returns an error when JSON parsing or any profile validation rule fails.
Sourcepub fn from_json_for_production(bytes: &[u8]) -> Result<Self>
pub fn from_json_for_production(bytes: &[u8]) -> Result<Self>
Parses producer input, replaces the supplied chain.hash, and validates the result.
§Errors
Returns an error when JSON parsing, hashing, or any profile validation rule fails.
Sourcepub fn to_jcs(&self) -> Result<Vec<u8>>
pub fn to_jcs(&self) -> Result<Vec<u8>>
Returns the RFC 8785 JCS serialization of the complete payload.
§Errors
Returns an error if the payload cannot be serialized.
Sourcepub const fn attestation_binding_mode(&self) -> &BindingMode
pub const fn attestation_binding_mode(&self) -> &BindingMode
Returns the witness key identifier used as the CWT issuer by the CLI.
Sourcepub fn witness_key(&self) -> &str
pub fn witness_key(&self) -> &str
Key identifier of the TEE signing key.
Sourcepub fn chain_hash(&self) -> &str
pub fn chain_hash(&self) -> &str
Returns the stored chain digest.
Sourcepub fn chain_prev_hash(&self) -> Option<&str>
pub fn chain_prev_hash(&self) -> Option<&str>
Returns the preceding receipt’s chain.hash, or None at sequence zero.
Sourcepub const fn issuer_affiliation(&self) -> &IssuerAffiliation
pub const fn issuer_affiliation(&self) -> &IssuerAffiliation
Returns whether the Site Owner and the Issuer are affiliated parties.
A value outside the closed set is returned as
IssuerAffiliation::Unrecognized carrying the original string, never
folded into one of the named values. IssuerAffiliation::NotDisclosed
means nobody made a claim and MUST NOT be read as a claim of
independence. See IssuerAffiliation for why.
Sourcepub const fn adapter_ack_provenance(&self) -> &AckProvenance
pub const fn adapter_ack_provenance(&self) -> &AckProvenance
Returns how the acknowledgement in adapter.ackDigest was obtained.
A value outside the closed set is returned as
AckProvenance::Unrecognized carrying the original string, never
folded into one of the named values. See AckProvenance for why.
Sourcepub fn actor_operator(&self) -> &str
pub fn actor_operator(&self) -> &str
Returns the operator string associated with the actor.
Sourcepub fn engagement_id(&self) -> &str
pub fn engagement_id(&self) -> &str
Returns the stable engagement identifier.
Sourcepub fn engagement_type(&self) -> &str
pub fn engagement_type(&self) -> &str
Returns the engagement type string (RFC 3986 URI or short identifier per §6 of the draft).
Sourcepub fn engagement_window_start(&self) -> &str
pub fn engagement_window_start(&self) -> &str
Returns the RFC 3339 UTC start of the engagement window.
Sourcepub fn engagement_window_end(&self) -> &str
pub fn engagement_window_end(&self) -> &str
Returns the RFC 3339 UTC end of the engagement window.
Sourcepub fn engagement_evidence_digest(&self) -> &str
pub fn engagement_evidence_digest(&self) -> &str
Returns the SHA-256 digest of the raw evidence bundle referenced by this engagement.
Sourcepub fn attestation_tee_class(&self) -> &str
pub fn attestation_tee_class(&self) -> &str
Returns the TEE class identifier.
Sourcepub fn sealed_evidence_digest(&self) -> &str
pub fn sealed_evidence_digest(&self) -> &str
Returns the SHA-256 digest of the sealed evidence blob.
Sourcepub fn sealed_evidence_size_bytes(&self) -> u64
pub fn sealed_evidence_size_bytes(&self) -> u64
Returns the size in bytes of the sealed evidence blob.
Sourcepub fn sealed_evidence_encoding(&self) -> &str
pub fn sealed_evidence_encoding(&self) -> &str
Returns the sealed evidence encoding identifier.
Sourcepub fn adapter_system(&self) -> &str
pub fn adapter_system(&self) -> &str
Returns the operations-layer system identifier.
This value selects which write-in adapter is responsible for pushing this receipt.
Values are defined by the PSER profile registry (see §6 of the draft). Example
values: "buildium", "propertymeld".
Sourcepub fn adapter_endpoint(&self) -> &str
pub fn adapter_endpoint(&self) -> &str
Returns the opaque per-system endpoint identifier.
The value is interpreted by the target adapter, not by pask-wire. For the
buildium adapter it is the Buildium rental property ID; for other adapters,
consult the adapter documentation.
Sourcepub fn adapter_posted_at(&self) -> &str
pub fn adapter_posted_at(&self) -> &str
Returns the RFC 3339 UTC timestamp at which the write-in was posted.
Sourcepub fn adapter_ack_digest(&self) -> &str
pub fn adapter_ack_digest(&self) -> &str
Returns the SHA-256 digest of the operations-layer acknowledgement.
Sourcepub fn adapter_is_write_only(&self) -> bool
pub fn adapter_is_write_only(&self) -> bool
Returns whether the receipt is marked WRITE_ONLY.
Every wilder.pser/0.3 receipt that parses successfully MUST be WRITE_ONLY;
this accessor exists so downstream adapters can enforce the property as
defense-in-depth without pattern-matching the internal enum.