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§
source§impl 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.
Trait Implementations§
source§impl<P: KeyPurpose> Deref for Key<P>
impl<P: KeyPurpose> Deref 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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more