Struct serde_encrypt::shared_key::SharedKey [−][src]
pub struct SharedKey(_);
Expand description
32-byte key shared among sender and receiver secretly.
It is a good practice to use SerdeEncryptPublicKey to exchange this shared key.
Trait Implementations
type R = RngSingletonImpl
type R = RngSingletonImpl
RNG singleton
Constructor from secret bytes.
fn to_chacha_key(
&self
) -> &GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>
fn to_chacha_key(
&self
) -> &GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>
Makes chacha20poly1305::Key
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
type S = BincodeSerializer<Self>
type S = BincodeSerializer<Self>
Serializer implementation
fn encrypt(
&self,
combined_key: &SenderCombinedKey<'_, '_>
) -> Result<EncryptedMessage, Error> where
Self: Serialize,
fn encrypt(
&self,
combined_key: &SenderCombinedKey<'_, '_>
) -> Result<EncryptedMessage, Error> where
Self: Serialize,
Serialize and encrypt. Read more
fn decrypt_owned(
encrypted_message: &EncryptedMessage,
combined_key: &ReceiverCombinedKey<'_, '_>
) -> Result<Self, Error> where
Self: DeserializeOwned,
fn decrypt_owned(
encrypted_message: &EncryptedMessage,
combined_key: &ReceiverCombinedKey<'_, '_>
) -> Result<Self, Error> where
Self: DeserializeOwned,
Decrypt and deserialize into DeserializeOwned type. Read more
fn decrypt_ref<'de>(
encrypted_message: &EncryptedMessage,
combined_key: &ReceiverCombinedKey<'_, '_>
) -> Result<Self::S, Error> where
Self: Deserialize<'de>,
fn decrypt_ref<'de>(
encrypted_message: &EncryptedMessage,
combined_key: &ReceiverCombinedKey<'_, '_>
) -> Result<Self::S, Error> where
Self: Deserialize<'de>,
Just decrypts cipher-text. Returned data must be deserialized later.
Types implementing serde::Deserialize<'de>
(not serde::de::DeserializeOwned
) should use
this function to resolve lifetime. Read more
Auto Trait Implementations
impl RefUnwindSafe for SharedKey
impl UnwindSafe for SharedKey
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