Struct serde_encrypt::shared_key::SharedKey
source · [−]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.
Implementations
Trait Implementations
sourceimpl<'de> Deserialize<'de> for SharedKey
impl<'de> Deserialize<'de> for SharedKey
sourcefn 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
sourceimpl SerdeEncryptPublicKey for SharedKey
impl SerdeEncryptPublicKey for SharedKey
type S = BincodeSerializer<SharedKey>
type S = BincodeSerializer<SharedKey>
Serializer implementation
sourcefn 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
sourcefn 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
sourcefn 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
impl Eq for SharedKey
impl StructuralEq for SharedKey
impl StructuralPartialEq for SharedKey
Auto Trait Implementations
impl RefUnwindSafe for SharedKey
impl Send for SharedKey
impl Sync for SharedKey
impl Unpin for SharedKey
impl UnwindSafe for SharedKey
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more