pub struct Receipt { /* private fields */ }Expand description
A receipt (8.1) that has passed verification steps 1-4: strict JSON, structure, canonical
form and consistency. Its signature has not been checked; use crate::verify.
The members are private and read through getters, so the cached payload
and hash always describe them. A Receipt comes only from
from_json (or from_value for JSON already
parsed) and, with feature sign, from ReceiptBuilder::sign.
Implementations§
Source§impl Receipt
impl Receipt
Sourcepub fn from_json(bytes: &[u8]) -> Result<Receipt>
pub fn from_json(bytes: &[u8]) -> Result<Receipt>
Parses a receipt and runs verification steps 1-4 (10.1).
Sourcepub fn from_value(v: &Value) -> Result<Receipt>
pub fn from_value(v: &Value) -> Result<Receipt>
Runs verification steps 2-4 on a parsed JSON value.
Sourcepub fn payload(&self) -> &[u8] ⓘ
pub fn payload(&self) -> &[u8] ⓘ
The signed payload: canonical bytes of the receipt without sig (8.3).
Sourcepub fn computed_by(&self) -> &str
pub fn computed_by(&self) -> &str
<host>#<key id> of the signing key.
Sourcepub fn inputs(&self) -> &[String]
pub fn inputs(&self) -> &[String]
The inputs entries, ascending: receipt hashes and, since spec-0.4.0, slice entries
slice:<slice id>:<members hash> (which sort after every receipt hash).
Sourcepub fn signer_host(&self) -> &str
pub fn signer_host(&self) -> &str
The host of computed_by.