pub struct Signed<T> { /* private fields */ }Expand description
A signed object whose signature has been made or verified, with its exact bytes.
Implementations§
Source§impl<T: SignedObject> Signed<T>
impl<T: SignedObject> Signed<T>
Sourcepub fn verify_and_decode(
bytes: &[u8],
sig: &Signature,
key: &PublicKey,
min_suite: u8,
) -> Result<Self, SignedError>
pub fn verify_and_decode( bytes: &[u8], sig: &Signature, key: &PublicKey, min_suite: u8, ) -> Result<Self, SignedError>
Verifies sig over bytes under key with T’s context, then decodes (§3.6).
§Errors
SignedError::Signature before any decoding, or SignedError::Decode.
Sourcepub fn from_json(
json: &SignedJson,
key: &PublicKey,
min_suite: u8,
) -> Result<Self, SignedError>
pub fn from_json( json: &SignedJson, key: &PublicKey, min_suite: u8, ) -> Result<Self, SignedError>
Self::verify_and_decode for the JSON form {bytes, sig}.
§Errors
SignedError::SignatureEncoding for a malformed sig, else as verify_and_decode.
Source§impl<T> Signed<T>
impl<T> Signed<T>
Sourcepub fn into_object(self) -> T
pub fn into_object(self) -> T
The decoded object, consuming the wrapper.
Sourcepub fn to_json(&self) -> SignedJson
pub fn to_json(&self) -> SignedJson
The JSON form {bytes, sig} (§3.6).
Trait Implementations§
impl<T: Eq> Eq for Signed<T>
Source§impl<T> From<Signed<T>> for SignedJson
impl<T> From<Signed<T>> for SignedJson
impl<T: PartialEq> StructuralPartialEq for Signed<T>
Auto Trait Implementations§
impl<T> Freeze for Signed<T>where
T: Freeze,
impl<T> RefUnwindSafe for Signed<T>where
T: RefUnwindSafe,
impl<T> Send for Signed<T>where
T: Send,
impl<T> Sync for Signed<T>where
T: Sync,
impl<T> Unpin for Signed<T>where
T: Unpin,
impl<T> UnsafeUnpin for Signed<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Signed<T>where
T: UnwindSafe,
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