pub struct KeyWrapper { /* private fields */ }Expand description
Key wrapper using AES-256-GCM
Implementations§
Source§impl KeyWrapper
impl KeyWrapper
Sourcepub fn new(kek: &KeyEncryptionKey) -> Result<Self, KeyWrapError>
pub fn new(kek: &KeyEncryptionKey) -> Result<Self, KeyWrapError>
Create a new key wrapper with the given KEK
Sourcepub fn wrap(&self, key: &[u8], key_id: &str) -> Result<WrappedKey, KeyWrapError>
pub fn wrap(&self, key: &[u8], key_id: &str) -> Result<WrappedKey, KeyWrapError>
Wrap a key
Sourcepub fn unwrap(&self, wrapped: &WrappedKey) -> Result<Vec<u8>, KeyWrapError>
pub fn unwrap(&self, wrapped: &WrappedKey) -> Result<Vec<u8>, KeyWrapError>
Unwrap a key
Sourcepub fn rewrap(
&self,
wrapped: &WrappedKey,
new_wrapper: &KeyWrapper,
) -> Result<WrappedKey, KeyWrapError>
pub fn rewrap( &self, wrapped: &WrappedKey, new_wrapper: &KeyWrapper, ) -> Result<WrappedKey, KeyWrapError>
Rewrap a key with a new KEK
Auto Trait Implementations§
impl Freeze for KeyWrapper
impl RefUnwindSafe for KeyWrapper
impl Send for KeyWrapper
impl Sync for KeyWrapper
impl Unpin for KeyWrapper
impl UnwindSafe for KeyWrapper
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