pub struct KeyHierarchy { /* private fields */ }Expand description
Key hierarchy manager for multi-level key wrapping
Implementations§
Source§impl KeyHierarchy
impl KeyHierarchy
Sourcepub fn new(master_kek: KeyEncryptionKey) -> Result<Self, KeyWrapError>
pub fn new(master_kek: KeyEncryptionKey) -> Result<Self, KeyWrapError>
Create a new key hierarchy with a master KEK
Sourcepub fn add_level(&mut self) -> Result<WrappedKey, KeyWrapError>
pub fn add_level(&mut self) -> Result<WrappedKey, KeyWrapError>
Add a new level to the hierarchy
Sourcepub fn get_level_wrapper(
&self,
level: usize,
) -> Result<KeyWrapper, KeyWrapError>
pub fn get_level_wrapper( &self, level: usize, ) -> Result<KeyWrapper, KeyWrapError>
Get wrapper for a specific level
Sourcepub fn wrap_data_key(
&self,
key: &[u8],
level: usize,
key_id: &str,
) -> Result<WrappedKey, KeyWrapError>
pub fn wrap_data_key( &self, key: &[u8], level: usize, key_id: &str, ) -> Result<WrappedKey, KeyWrapError>
Wrap a data key at a specific level
Sourcepub fn unwrap_data_key(
&self,
wrapped: &WrappedKey,
level: usize,
) -> Result<Vec<u8>, KeyWrapError>
pub fn unwrap_data_key( &self, wrapped: &WrappedKey, level: usize, ) -> Result<Vec<u8>, KeyWrapError>
Unwrap a data key at a specific level
Auto Trait Implementations§
impl Freeze for KeyHierarchy
impl RefUnwindSafe for KeyHierarchy
impl Send for KeyHierarchy
impl Sync for KeyHierarchy
impl Unpin for KeyHierarchy
impl UnwindSafe for KeyHierarchy
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