pub struct WrappedKey { /* private fields */ }Expand description
One recipient’s wrapped copy of the data key.
The pairing of “who” with “the bytes only they can open” is the whole point:
a WrappedKey cannot exist without its ciphertext, which is why deriving the
metadata’s recipient lists from a set of these closes the declared-vs-actual
gap.
Implementations§
Source§impl WrappedKey
impl WrappedKey
Sourcepub fn age(recipient: impl Into<String>, enc: impl Into<String>) -> Self
pub fn age(recipient: impl Into<String>, enc: impl Into<String>) -> Self
An age recipient plus its armored wrapped key.
Sourcepub fn opaque(
provider: KeyProvider,
recipient: impl Into<String>,
enc: impl Into<String>,
created_at: Option<String>,
) -> Self
pub fn opaque( provider: KeyProvider, recipient: impl Into<String>, enc: impl Into<String>, created_at: Option<String>, ) -> Self
A key for a provider we do not unwrap, preserved so the file round-trips.
pub fn provider(&self) -> KeyProvider
pub fn recipient(&self) -> &str
Sourcepub fn enc(&self) -> &str
pub fn enc(&self) -> &str
The wrapped key bytes as they appear on the wire.
Not a secret in itself — it is ciphertext, and it ships in the file.
pub fn created_at(&self) -> Option<&str>
Trait Implementations§
Source§impl Clone for WrappedKey
impl Clone for WrappedKey
Source§fn clone(&self) -> WrappedKey
fn clone(&self) -> WrappedKey
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WrappedKey
impl Debug for WrappedKey
impl Eq for WrappedKey
Source§impl PartialEq for WrappedKey
impl PartialEq for WrappedKey
impl StructuralPartialEq for WrappedKey
Auto Trait Implementations§
impl Freeze for WrappedKey
impl RefUnwindSafe for WrappedKey
impl Send for WrappedKey
impl Sync for WrappedKey
impl Unpin for WrappedKey
impl UnsafeUnpin for WrappedKey
impl UnwindSafe for WrappedKey
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