Struct magic_wormhole::Key
source · [−]pub struct Key<P: KeyPurpose>(pub Box<Key>, _);Expand description
The symmetric encryption key used to communicate with the other side.
You don’t need to do any crypto, but you might need it to derive subkeys for sub-protocols.
Tuple Fields
0: Box<Key>Implementations
sourceimpl Key<WormholeKey>
impl Key<WormholeKey>
sourcepub fn derive_transit_key(&self, appid: &AppID) -> Key<TransitKey>
pub fn derive_transit_key(&self, appid: &AppID) -> Key<TransitKey>
Derive the sub-key used for transit
This one’s a bit special, since the Wormhole’s AppID is included in the purpose. Different kinds of applications can’t talk to each other, not even accidentally, by design.
The new key is derived with the "{appid}/transit-key" purpose.
sourceimpl<P: KeyPurpose> Key<P>
impl<P: KeyPurpose> Key<P>
Trait Implementations
sourceimpl<P: Clone + KeyPurpose> Clone for Key<P>
impl<P: Clone + KeyPurpose> Clone for Key<P>
sourceimpl<P: Debug + KeyPurpose> Debug for Key<P>
impl<P: Debug + KeyPurpose> Debug for Key<P>
Auto Trait Implementations
impl<P> RefUnwindSafe for Key<P> where
P: RefUnwindSafe,
impl<P> Send for Key<P> where
P: Send,
impl<P> Sync for Key<P> where
P: Sync,
impl<P> Unpin for Key<P> where
P: Unpin,
impl<P> UnwindSafe for Key<P> where
P: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more