Struct serde_encrypt::EncryptedMessage [−][src]
pub struct EncryptedMessage { /* fields omitted */ }
Expand description
Encrypted message structure.
This struct is serialized into Vec<u8>
(and deserialized from Vec<u8>
).
In order to send an EncryptedMessage to a remote receiver, use let bin = encrypted_message.serialize();
.
Then, the receiver should deserialize it by let encrypted_message = EncryptedMessage::deserialize(bin);
.
This struct includes Nonce, which is internally used when a receiver decrypt the encrypted message.
Implementations
Serialize this encrypted message into binary in order to send it to a remote receiver.
pub fn deserialize(
serialized_encrypted_message: Vec<u8, Global>
) -> Result<EncryptedMessage, Error>
pub fn deserialize(
serialized_encrypted_message: Vec<u8, Global>
) -> Result<EncryptedMessage, Error>
Deserializer function for a receiver.
Failures
- DeserializationError when:
- binary data does not have nonce.
Ref to XChaCha20 nonce (192-bit / 24-byte) used to create this encrypted message.
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for EncryptedMessage
impl Send for EncryptedMessage
impl Sync for EncryptedMessage
impl Unpin for EncryptedMessage
impl UnwindSafe for EncryptedMessage
Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self
pub fn vzip(self) -> V