Trait fxfs_crypto::Crypt

source ·
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), Error>> + 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, Error>> + 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, Error>> + 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§

source

fn create_key<'life0, 'async_trait>( &'life0 self, owner: u64, purpose: KeyPurpose ) -> Pin<Box<dyn Future<Output = Result<(WrappedKey, UnwrappedKey), Error>> + 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.

source

fn unwrap_key<'life0, 'life1, 'async_trait>( &'life0 self, wrapped_key: &'life1 WrappedKey, owner: u64 ) -> Pin<Box<dyn Future<Output = Result<UnwrappedKey, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Provided Methods§

source

fn unwrap_keys<'life0, 'life1, 'async_trait>( &'life0 self, keys: &'life1 WrappedKeys, owner: u64 ) -> Pin<Box<dyn Future<Output = Result<UnwrappedKeys, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Unwraps the keys and stores the result in UnwrappedKeys.

Implementors§