Struct bdrck::crypto::key::WrappedKey
source · pub struct WrappedKey { /* private fields */ }
Expand description
A wrapped key is a Key which has been wrapped (encrypted) with another key. This is useful because it lets us have e.g. a single “master key” which is wrapped by several sub-keys, which can be added / removed at will without having to actually re-encrypt all of the data encrypted with the “master key”.
Implementations
sourceimpl WrappedKey
impl WrappedKey
sourcepub fn get_digest(&self) -> Digest
pub fn get_digest(&self) -> Digest
Return a digest/signature computed from this key.
sourcepub fn get_wrapping_digest(&self) -> &Digest
pub fn get_wrapping_digest(&self) -> &Digest
Return the digest/signature of the outermost key used to wrap this key.
sourcepub fn unwrap<K: AbstractKey>(self, key: &K) -> Result<WrappedPayload>
pub fn unwrap<K: AbstractKey>(self, key: &K) -> Result<WrappedPayload>
Unwrap this WrappedKey using the given key for decryption. This can return either a Key, or another WrappedKey if the underlying key was wrapped more than one time.
Trait Implementations
sourceimpl Clone for WrappedKey
impl Clone for WrappedKey
sourcefn clone(&self) -> WrappedKey
fn clone(&self) -> WrappedKey
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl<'de> Deserialize<'de> for WrappedKey
impl<'de> Deserialize<'de> for WrappedKey
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Serialize for WrappedKey
impl Serialize for WrappedKey
sourceimpl Wrappable for WrappedKey
impl Wrappable for WrappedKey
sourcefn wrap<K: AbstractKey>(self, key: &K) -> Result<WrappedKey>
fn wrap<K: AbstractKey>(self, key: &K) -> Result<WrappedKey>
This function “wraps” (encrypts, roughly) self with the given
AbstractKey. Read more
Auto Trait Implementations
impl RefUnwindSafe for WrappedKey
impl Send for WrappedKey
impl Sync for WrappedKey
impl Unpin for WrappedKey
impl UnwindSafe for WrappedKey
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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