[−][src]Struct interledger_stream::ConnectionGenerator
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]
&self,
base_address: &Address
) -> (Address, [u8; 32])
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]
&self,
destination_account: &Address
) -> Result<[u8; 32], ()>
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]
fn clone(&self) -> ConnectionGenerator
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl Send for ConnectionGenerator
impl Sync for ConnectionGenerator
impl Unpin for ConnectionGenerator
impl UnwindSafe for ConnectionGenerator
impl RefUnwindSafe for ConnectionGenerator
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,