[−][src]Struct tox_packet::dht::CookieResponse
Response to a CookieRequest
packet.
Encrypted payload is encrypted with the same symmetric key as the
CookieRequest
packet it responds to but with a different nonce.
Serialized form:
Length | Content |
---|---|
1 | 0x19 |
24 | Nonce |
136 | Payload |
Fields
nonce: Nonce
Nonce for the current encrypted payload
payload: Vec<u8>
Encrypted payload
Implementations
impl CookieResponse
[src]
pub fn new(
shared_secret: &PrecomputedKey,
payload: &CookieResponsePayload
) -> CookieResponse
[src]
shared_secret: &PrecomputedKey,
payload: &CookieResponsePayload
) -> CookieResponse
Create CookieResponse
from CookieRequestPayload
encrypting it with shared_key
pub fn get_payload(
&self,
shared_secret: &PrecomputedKey
) -> Result<CookieResponsePayload, GetPayloadError>
[src]
&self,
shared_secret: &PrecomputedKey
) -> Result<CookieResponsePayload, GetPayloadError>
Decrypt payload with precomputed key and try to parse it as CookieResponsePayload
.
Returns Error
in case of failure:
- fails to decrypt
- fails to parse
CookieResponsePayload
Trait Implementations
impl Clone for CookieResponse
[src]
pub fn clone(&self) -> CookieResponse
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for CookieResponse
[src]
impl Eq for CookieResponse
[src]
impl FromBytes for CookieResponse
[src]
impl PartialEq<CookieResponse> for CookieResponse
[src]
pub fn eq(&self, other: &CookieResponse) -> bool
[src]
pub fn ne(&self, other: &CookieResponse) -> bool
[src]
impl StructuralEq for CookieResponse
[src]
impl StructuralPartialEq for CookieResponse
[src]
impl ToBytes for CookieResponse
[src]
Auto Trait Implementations
impl RefUnwindSafe for CookieResponse
[src]
impl Send for CookieResponse
[src]
impl Sync for CookieResponse
[src]
impl Unpin for CookieResponse
[src]
impl UnwindSafe for CookieResponse
[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>,