[][src]Struct interledger_stream::ConnectionGenerator

pub struct ConnectionGenerator { /* fields omitted */ }

A STREAM connection generator that creates destination_account and shared_secret values based on a single root secret.

This can be reused across multiple STREAM connections so that a single receiver can accept incoming packets for multiple connections.

Methods

impl ConnectionGenerator[src]

pub fn new(server_secret: Bytes) -> Self[src]

pub fn generate_address_and_secret(
    &self,
    base_address: &Address
) -> (Address, [u8; 32])
[src]

Generate the STREAM parameters for the given ILP address and the configured server secret.

The destination_account is generated such that the shared_secret can be re-derived from a Prepare packet's destination and the same server secret. If the address is modified in any way, the server will not be able to re-derive the secret and the packet will be rejected.

pub fn rederive_secret(
    &self,
    destination_account: &Address
) -> Result<[u8; 32], ()>
[src]

Rederive the shared_secret from a destination_account. This will return an error if the address has been modified in any way or if the packet was not generated with the same server secret.

Trait Implementations

impl Clone for ConnectionGenerator[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]