pub trait Crypt: Send + Sync {
// Required methods
fn create_key<'life0, 'async_trait>(
&'life0 self,
owner: u64,
purpose: KeyPurpose,
) -> Pin<Box<dyn Future<Output = Result<(WrappedKey, UnwrappedKey), Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn create_key_with_id<'life0, 'async_trait>(
&'life0 self,
owner: u64,
wrapping_key_id: u128,
) -> Pin<Box<dyn Future<Output = Result<(WrappedKey, UnwrappedKey), Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn unwrap_key<'life0, 'life1, 'async_trait>(
&'life0 self,
wrapped_key: &'life1 WrappedKey,
owner: u64,
) -> Pin<Box<dyn Future<Output = Result<UnwrappedKey, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided method
fn unwrap_keys<'life0, 'life1, 'async_trait>(
&'life0 self,
keys: &'life1 WrappedKeys,
owner: u64,
) -> Pin<Box<dyn Future<Output = Result<UnwrappedKeys, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}
Expand description
An interface trait with the ability to wrap and unwrap encryption keys.
Note that existence of this trait does not imply that an object will securely wrap and unwrap keys; rather just that it presents an interface for wrapping operations.
Required Methods§
Sourcefn create_key<'life0, 'async_trait>(
&'life0 self,
owner: u64,
purpose: KeyPurpose,
) -> Pin<Box<dyn Future<Output = Result<(WrappedKey, UnwrappedKey), Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_key<'life0, 'async_trait>(
&'life0 self,
owner: u64,
purpose: KeyPurpose,
) -> Pin<Box<dyn Future<Output = Result<(WrappedKey, UnwrappedKey), Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
owner
is intended to be used such that when the key is wrapped, it appears to be different
to that of the same key wrapped by a different owner. In this way, keys can be shared
amongst different filesystem objects (e.g. for clones), but it is not possible to tell just
by looking at the wrapped keys.
Sourcefn create_key_with_id<'life0, 'async_trait>(
&'life0 self,
owner: u64,
wrapping_key_id: u128,
) -> Pin<Box<dyn Future<Output = Result<(WrappedKey, UnwrappedKey), Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_key_with_id<'life0, 'async_trait>(
&'life0 self,
owner: u64,
wrapping_key_id: u128,
) -> Pin<Box<dyn Future<Output = Result<(WrappedKey, UnwrappedKey), Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
owner
is intended to be used such that when the key is wrapped, it appears to be different
to that of the same key wrapped by a different owner. In this way, keys can be shared
amongst different filesystem objects (e.g. for clones), but it is not possible to tell just
by looking at the wrapped keys.
fn unwrap_key<'life0, 'life1, 'async_trait>(
&'life0 self,
wrapped_key: &'life1 WrappedKey,
owner: u64,
) -> Pin<Box<dyn Future<Output = Result<UnwrappedKey, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Provided Methods§
Sourcefn unwrap_keys<'life0, 'life1, 'async_trait>(
&'life0 self,
keys: &'life1 WrappedKeys,
owner: u64,
) -> Pin<Box<dyn Future<Output = Result<UnwrappedKeys, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn unwrap_keys<'life0, 'life1, 'async_trait>(
&'life0 self,
keys: &'life1 WrappedKeys,
owner: u64,
) -> Pin<Box<dyn Future<Output = Result<UnwrappedKeys, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Unwraps the keys and stores the result in UnwrappedKeys.