Struct dryoc::sign::SignedMessage
source · pub struct SignedMessage<Signature: ByteArray<CRYPTO_SIGN_BYTES> + Zeroize, Message: Bytes + Zeroize> { /* private fields */ }
Expand description
A signed message, for use with SigningKeyPair
.
Implementations§
source§impl<Signature: ByteArray<CRYPTO_SIGN_BYTES> + Zeroize, Message: Bytes + Zeroize> SignedMessage<Signature, Message>
impl<Signature: ByteArray<CRYPTO_SIGN_BYTES> + Zeroize, Message: Bytes + Zeroize> SignedMessage<Signature, Message>
source§impl<'a, Signature: ByteArray<CRYPTO_SIGN_BYTES> + TryFrom<&'a [u8]> + Zeroize, Message: Bytes + From<&'a [u8]> + Zeroize> SignedMessage<Signature, Message>
impl<'a, Signature: ByteArray<CRYPTO_SIGN_BYTES> + TryFrom<&'a [u8]> + Zeroize, Message: Bytes + From<&'a [u8]> + Zeroize> SignedMessage<Signature, Message>
sourcepub fn from_bytes(bytes: &'a [u8]) -> Result<Self, Error>
pub fn from_bytes(bytes: &'a [u8]) -> Result<Self, Error>
Initializes a SignedMessage
from a slice. Expects the first
CRYPTO_SIGN_BYTES
bytes to contain the message signature,
with the remaining bytes containing the message.
source§impl<Signature: ByteArray<CRYPTO_SIGN_BYTES> + Zeroize, Message: Bytes + Zeroize> SignedMessage<Signature, Message>
impl<Signature: ByteArray<CRYPTO_SIGN_BYTES> + Zeroize, Message: Bytes + Zeroize> SignedMessage<Signature, Message>
sourcepub fn from_parts(signature: Signature, message: Message) -> Self
pub fn from_parts(signature: Signature, message: Message) -> Self
Returns a new box with tag
, data
and (optional) ephemeral_pk
,
consuming each.
sourcepub fn into_parts(self) -> (Signature, Message)
pub fn into_parts(self) -> (Signature, Message)
Moves the tag, data, and (optional) ephemeral public key out of this instance, returning them as a tuple.
sourcepub fn to_bytes<Bytes: NewBytes + ResizableBytes>(&self) -> Bytes
pub fn to_bytes<Bytes: NewBytes + ResizableBytes>(&self) -> Bytes
Copies self
into the target. Can be used with protected memory.
Trait Implementations§
source§impl<Signature: Clone + ByteArray<CRYPTO_SIGN_BYTES> + Zeroize, Message: Clone + Bytes + Zeroize> Clone for SignedMessage<Signature, Message>
impl<Signature: Clone + ByteArray<CRYPTO_SIGN_BYTES> + Zeroize, Message: Clone + Bytes + Zeroize> Clone for SignedMessage<Signature, Message>
source§fn clone(&self) -> SignedMessage<Signature, Message>
fn clone(&self) -> SignedMessage<Signature, Message>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<Signature: Debug + ByteArray<CRYPTO_SIGN_BYTES> + Zeroize, Message: Debug + Bytes + Zeroize> Debug for SignedMessage<Signature, Message>
impl<Signature: Debug + ByteArray<CRYPTO_SIGN_BYTES> + Zeroize, Message: Debug + Bytes + Zeroize> Debug for SignedMessage<Signature, Message>
source§impl<'de, Signature, Message> Deserialize<'de> for SignedMessage<Signature, Message>where
Signature: Deserialize<'de> + ByteArray<CRYPTO_SIGN_BYTES> + Zeroize,
Message: Deserialize<'de> + Bytes + Zeroize,
impl<'de, Signature, Message> Deserialize<'de> for SignedMessage<Signature, Message>where
Signature: Deserialize<'de> + ByteArray<CRYPTO_SIGN_BYTES> + Zeroize,
Message: Deserialize<'de> + Bytes + Zeroize,
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
source§impl<Signature: ByteArray<CRYPTO_SIGN_BYTES> + Zeroize, Message: Bytes + Zeroize> PartialEq for SignedMessage<Signature, Message>
impl<Signature: ByteArray<CRYPTO_SIGN_BYTES> + Zeroize, Message: Bytes + Zeroize> PartialEq for SignedMessage<Signature, Message>
source§impl<Signature, Message> Serialize for SignedMessage<Signature, Message>
impl<Signature, Message> Serialize for SignedMessage<Signature, Message>
source§impl<Signature, Message> Zeroize for SignedMessage<Signature, Message>
impl<Signature, Message> Zeroize for SignedMessage<Signature, Message>
Auto Trait Implementations§
impl<Signature, Message> RefUnwindSafe for SignedMessage<Signature, Message>where
Message: RefUnwindSafe,
Signature: RefUnwindSafe,
impl<Signature, Message> Send for SignedMessage<Signature, Message>
impl<Signature, Message> Sync for SignedMessage<Signature, Message>
impl<Signature, Message> Unpin for SignedMessage<Signature, Message>
impl<Signature, Message> UnwindSafe for SignedMessage<Signature, Message>where
Message: UnwindSafe,
Signature: 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