Struct dryoc::sign::SignedMessage
source · pub struct SignedMessage<Signature: ByteArray<CRYPTO_SIGN_BYTES>, Message: Bytes> { /* private fields */ }
Expand description
A signed message, for use with SigningKeyPair
.
Implementations§
source§impl<Signature: ByteArray<CRYPTO_SIGN_BYTES>, Message: Bytes> SignedMessage<Signature, Message>
impl<Signature: ByteArray<CRYPTO_SIGN_BYTES>, Message: Bytes> SignedMessage<Signature, Message>
source§impl<'a, Signature: ByteArray<CRYPTO_SIGN_BYTES> + TryFrom<&'a [u8]>, Message: Bytes + From<&'a [u8]>> SignedMessage<Signature, Message>
impl<'a, Signature: ByteArray<CRYPTO_SIGN_BYTES> + TryFrom<&'a [u8]>, Message: Bytes + From<&'a [u8]>> 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>, Message: Bytes> SignedMessage<Signature, Message>
impl<Signature: ByteArray<CRYPTO_SIGN_BYTES>, Message: Bytes> 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>, Message: Clone + Bytes> Clone for SignedMessage<Signature, Message>
impl<Signature: Clone + ByteArray<CRYPTO_SIGN_BYTES>, Message: Clone + Bytes> 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>, Message: Debug + Bytes> Debug for SignedMessage<Signature, Message>
impl<Signature: Debug + ByteArray<CRYPTO_SIGN_BYTES>, Message: Debug + Bytes> Debug for SignedMessage<Signature, Message>
source§impl<'de, Signature, Message> Deserialize<'de> for SignedMessage<Signature, Message>where
Signature: Deserialize<'de> + ByteArray<CRYPTO_SIGN_BYTES>,
Message: Deserialize<'de> + Bytes,
impl<'de, Signature, Message> Deserialize<'de> for SignedMessage<Signature, Message>where Signature: Deserialize<'de> + ByteArray<CRYPTO_SIGN_BYTES>, Message: Deserialize<'de> + Bytes,
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