[−][src]Struct tox_packet::onion::OnionRequest0
First onion request packet. It's sent from DHT node to the first node from
onion chain. Payload can be encrypted with either temporary generated
SecretKey
or DHT SecretKey
of sender and with DHT PublicKey
of receiver.
Serialized form:
Length | Content |
---|---|
1 | 0x80 |
24 | Nonce |
32 | PublicKey of sender |
variable | Payload |
where payload is encrypted OnionRequest0Payload
Fields
nonce: Nonce
Nonce for the current encrypted payload
temporary_pk: PublicKey
Temporary PublicKey
for the current encrypted payload
payload: Vec<u8>
Encrypted payload
Implementations
impl OnionRequest0
[src]
pub fn new(
shared_secret: &PrecomputedKey,
temporary_pk: &PublicKey,
payload: &OnionRequest0Payload
) -> OnionRequest0
[src]
shared_secret: &PrecomputedKey,
temporary_pk: &PublicKey,
payload: &OnionRequest0Payload
) -> OnionRequest0
Create new OnionRequest0
object.
pub fn get_payload(
&self,
shared_secret: &PrecomputedKey
) -> Result<OnionRequest0Payload, GetPayloadError>
[src]
&self,
shared_secret: &PrecomputedKey
) -> Result<OnionRequest0Payload, GetPayloadError>
Decrypt payload and try to parse it as OnionRequest0Payload
.
Returns Error
in case of failure:
- fails to decrypt
- fails to parse as
OnionRequest0Payload
Trait Implementations
impl Clone for OnionRequest0
[src]
pub fn clone(&self) -> OnionRequest0
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for OnionRequest0
[src]
impl Eq for OnionRequest0
[src]
impl FromBytes for OnionRequest0
[src]
impl PartialEq<OnionRequest0> for OnionRequest0
[src]
pub fn eq(&self, other: &OnionRequest0) -> bool
[src]
pub fn ne(&self, other: &OnionRequest0) -> bool
[src]
impl StructuralEq for OnionRequest0
[src]
impl StructuralPartialEq for OnionRequest0
[src]
impl ToBytes for OnionRequest0
[src]
Auto Trait Implementations
impl RefUnwindSafe for OnionRequest0
[src]
impl Send for OnionRequest0
[src]
impl Sync for OnionRequest0
[src]
impl Unpin for OnionRequest0
[src]
impl UnwindSafe for OnionRequest0
[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>,