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>
👎Deprecated since 0.7.0: Use the AsRef<Key> implementation to get access to the secretbox key
Implementations§
Source§impl Key<WormholeKey>
impl Key<WormholeKey>
Sourcepub fn derive_transit_key(&self, appid: &AppID) -> Key<TransitKey>
👎Deprecated since 0.7.0: This will be a private method in the future. Open an issue if you require access to protocol intrinsics in the future
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> Freeze for Key<P>
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