pub struct SignedStatement {
pub payload: String,
pub signatures: Vec<Signature>,
}Expand description
A signed statement as it is stored and forwarded: the exact bytes that were
signed and the signatures over them. Carriers pass it through unchanged;
only enforcers verify it (see alien-signing).
A statement as it is stored and carried.
Fields§
§payload: StringBase64 of the payload bytes.
signatures: Vec<Signature>Signatures over the payload bytes.
Implementations§
Source§impl SignedStatement
impl SignedStatement
Sourcepub fn new(payload: &[u8]) -> SignedStatement
pub fn new(payload: &[u8]) -> SignedStatement
An unsigned statement around payload.
Sourcepub fn from_json(bytes: &[u8]) -> Result<SignedStatement, AlienError<ErrorData>>
pub fn from_json(bytes: &[u8]) -> Result<SignedStatement, AlienError<ErrorData>>
Parse the JSON form.
Source§impl SignedStatement
impl SignedStatement
Sourcepub fn sign_with(
self,
signer: &str,
key: &SecretKey,
) -> Result<SignedStatement, AlienError<ErrorData>>
pub fn sign_with( self, signer: &str, key: &SecretKey, ) -> Result<SignedStatement, AlienError<ErrorData>>
Add key’s signature as signer.
Trait Implementations§
Source§impl Clone for SignedStatement
impl Clone for SignedStatement
Source§fn clone(&self) -> SignedStatement
fn clone(&self) -> SignedStatement
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 SignedStatement
impl Debug for SignedStatement
Source§impl<'de> Deserialize<'de> for SignedStatement
impl<'de> Deserialize<'de> for SignedStatement
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SignedStatement, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SignedStatement, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for SignedStatement
Source§impl PartialEq for SignedStatement
impl PartialEq for SignedStatement
Source§impl Serialize for SignedStatement
impl Serialize for SignedStatement
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for SignedStatement
Auto Trait Implementations§
impl Forget for SignedStatement
impl Freeze for SignedStatement
impl Move for SignedStatement
impl RefUnwindSafe for SignedStatement
impl Send for SignedStatement
impl Sync for SignedStatement
impl Unpin for SignedStatement
impl UnsafeUnpin for SignedStatement
impl UnwindSafe for SignedStatement
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.