[−][src]Struct tox_packet::dht::EncryptedCookie
Encrypted with symmetric key Cookie
.
Serialized form:
Length | Content |
---|---|
24 | Nonce |
88 | Payload |
Fields
nonce: Nonce
Nonce for the current encrypted payload
payload: Vec<u8>
Encrypted payload
Implementations
impl EncryptedCookie
[src]
pub fn new(symmetric_key: &Key, payload: &Cookie) -> EncryptedCookie
[src]
Create EncryptedCookie
from Cookie
encrypting it with symmetric_key
pub fn get_payload(
&self,
symmetric_key: &Key
) -> Result<Cookie, GetPayloadError>
[src]
&self,
symmetric_key: &Key
) -> Result<Cookie, GetPayloadError>
Decrypt payload with symmetric key and try to parse it as Cookie
.
Returns Error
in case of failure:
- fails to decrypt
- fails to parse
Cookie
pub fn hash(&self) -> Digest
[src]
Calculate SHA512 hash of encrypted cookie together with nonce
Trait Implementations
impl Clone for EncryptedCookie
[src]
pub fn clone(&self) -> EncryptedCookie
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for EncryptedCookie
[src]
impl Eq for EncryptedCookie
[src]
impl FromBytes for EncryptedCookie
[src]
impl PartialEq<EncryptedCookie> for EncryptedCookie
[src]
pub fn eq(&self, other: &EncryptedCookie) -> bool
[src]
pub fn ne(&self, other: &EncryptedCookie) -> bool
[src]
impl StructuralEq for EncryptedCookie
[src]
impl StructuralPartialEq for EncryptedCookie
[src]
impl ToBytes for EncryptedCookie
[src]
Auto Trait Implementations
impl RefUnwindSafe for EncryptedCookie
[src]
impl Send for EncryptedCookie
[src]
impl Sync for EncryptedCookie
[src]
impl Unpin for EncryptedCookie
[src]
impl UnwindSafe for EncryptedCookie
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,