pub struct SignedDocument {
pub schema_version: u32,
pub payload_encoding: String,
pub payload_base64: String,
pub payload_sha256: String,
pub signatures: Vec<DocumentSignature>,
}Expand description
The signing envelope shared by every control document.
Fields§
§schema_version: u32Format version of the envelope.
payload_encoding: StringHow the payload is encoded.
payload_base64: StringThe payload, exactly as it was signed and published.
payload_sha256: StringSHA-256 of the decoded payload bytes.
signatures: Vec<DocumentSignature>Every signature offered; the document is accepted when any one of them verifies.
Implementations§
Source§impl SignedDocument
impl SignedDocument
Sourcepub fn parse(bytes: &[u8]) -> Result<Self>
pub fn parse(bytes: &[u8]) -> Result<Self>
Parses an envelope without verifying anything about it.
§Errors
When the bytes are not a structurally valid envelope.
Sourcepub fn decode_payload(&self) -> Result<Vec<u8>>
pub fn decode_payload(&self) -> Result<Vec<u8>>
Unwraps the envelope and checks its checksum. Does not check any signature.
§Errors
When the envelope is unsupported, or the payload bytes do not hash to the value it names.
Sourcepub fn is_well_formed(&self) -> bool
pub fn is_well_formed(&self) -> bool
Whether the envelope is well formed enough to be worth verifying.
A shape check, never a verification: it says the document deserves an attempt, not that its signature is good.
Trait Implementations§
Source§impl Clone for SignedDocument
impl Clone for SignedDocument
Source§fn clone(&self) -> SignedDocument
fn clone(&self) -> SignedDocument
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SignedDocument
impl Debug for SignedDocument
Source§impl<'de> Deserialize<'de> for SignedDocument
impl<'de> Deserialize<'de> for SignedDocument
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 SignedDocument
impl RefUnwindSafe for SignedDocument
impl Send for SignedDocument
impl Sync for SignedDocument
impl Unpin for SignedDocument
impl UnsafeUnpin for SignedDocument
impl UnwindSafe for SignedDocument
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