pub fn decrypt<T>(&self, msg: &[u8]) -> Result<T, DecryptionError>
    where
        T: Serialize + DeserializeOwned,
    {
        Ok(match *self {
            DecryptContext::NoEncryption => deserialize(msg)?,
            DecryptContext::Authenticated { ref shared_key } => shared_key.decrypt(msg)?,
            DecryptContext::AnonymousDecrypt {
                ref our_pk,
                ref our_sk,
            } => our_sk.anonymously_decrypt(msg, our_pk)?,
        })
    }
/// Decrypt given buffer and deserialize into structure.
Decrypt given buffer and deserialize into structure.
Decrypt given buffer and deserialize into structure .
pub fn decrypt<T>(&self, msg: &[u8]) -> Result<T, DecryptionError>
    where
        T: Serialize + DeserializeOwned,
    {
        Ok(match *self {
            DecryptContext::NoEncryption => deserialize(msg)?,
            DecryptContext::Authenticated { ref shared_key } => shared_key.decrypt(msg)?,
            DecryptContext::AnonymousDecrypt {
                ref our_pk,
                ref our_sk,
            } => our_sk.anonymously_decrypt(msg, our_pk)?,
        })
    }
pub fn decrypt < T > ( & self , msg : & [ u8 ] ) -> Result < T , DecryptionError > where T : Serialize + DeserializeOwned , { Ok ( match * self { DecryptContext :: NoEncryption => deserialize ( msg ) ? , DecryptContext :: Authenticated { ref shared_key } => shared_key . decrypt ( msg ) ? , DecryptContext :: AnonymousDecrypt { ref our_pk , ref our_sk , } => our_sk . anonymously_decrypt ( msg , our_pk ) ? , } ) }
Decrypt given buffer and deserialize into structure.
Decrypt given buffer and deserialize into structure .
&self
msg
&[u8]
&self
msg
&[u8]