Skip to main content

Luks2CryptDevice

Trait Luks2CryptDevice 

Source
pub trait Luks2CryptDevice: LuksCryptDevice {
Show 13 methods // Required methods fn register_new_token_handler<Handler: Luks2TokenHandlerRaw>( ) -> Result<Luks2TokenHandlerBox<Handler>>; fn register_token_handler<Handler: Luks2TokenHandlerRaw>( handler: &Luks2TokenHandlerBox<Handler>, ) -> Result<()>; fn token_status( &mut self, token_id: Luks2TokenId, ) -> (crypt_token_info, Option<String>); fn get_token(&mut self, token_id: Luks2TokenId) -> Result<Luks2Token>; fn add_token_with_id( &mut self, token: &Luks2Token, token_id: Luks2TokenId, ) -> Result<()>; fn add_token(&mut self, token: &Luks2Token) -> Result<Luks2TokenId>; fn remove_token(&mut self, token_id: Luks2TokenId) -> Result<()>; fn assign_token_to_keyslot( &mut self, token_id: Luks2TokenId, keyslot_opt: Option<Keyslot>, ) -> Result<()>; fn unassign_token_keyslot( &mut self, token_id: Luks2TokenId, keyslot_opt: Option<Keyslot>, ) -> Result<()>; fn token_keyslot_is_assigned( &mut self, token_id: Luks2TokenId, keyslot: Keyslot, ) -> Result<bool>; fn activate_with_token( &mut self, name: &str, token_id: Luks2TokenId, ) -> Result<Keyslot>; fn check_activation_with_token( &mut self, token_id: Luks2TokenId, ) -> Result<Keyslot>; fn set_pbkdf_params( &mut self, type_: crypt_pbkdf_algo_type, hash: &str, time_ms: u32, iterations: u32, max_memory_kb: u32, parallel_threads: u32, ) -> Result<()>;
}
Expand description

Trait representing specific operations on a LUKS2 device

Required Methods§

Source

fn register_new_token_handler<Handler: Luks2TokenHandlerRaw>() -> Result<Luks2TokenHandlerBox<Handler>>

Register a LUKS2 token handler

Source

fn register_token_handler<Handler: Luks2TokenHandlerRaw>( handler: &Luks2TokenHandlerBox<Handler>, ) -> Result<()>

Register a LUKS2 token handler given a reference to it

Source

fn token_status( &mut self, token_id: Luks2TokenId, ) -> (crypt_token_info, Option<String>)

Get token status for a given token id

Source

fn get_token(&mut self, token_id: Luks2TokenId) -> Result<Luks2Token>

Get a token by id

Source

fn add_token_with_id( &mut self, token: &Luks2Token, token_id: Luks2TokenId, ) -> Result<()>

Add a token with a specific id

Source

fn add_token(&mut self, token: &Luks2Token) -> Result<Luks2TokenId>

Add a token, returning the allocated token id

Source

fn remove_token(&mut self, token_id: Luks2TokenId) -> Result<()>

Remove a token by id

Source

fn assign_token_to_keyslot( &mut self, token_id: Luks2TokenId, keyslot_opt: Option<Keyslot>, ) -> Result<()>

Assign a token id to a keyslot (or all active keyslots if no keyslot is specified)

Source

fn unassign_token_keyslot( &mut self, token_id: Luks2TokenId, keyslot_opt: Option<Keyslot>, ) -> Result<()>

Unassing a token from a keyslot (or all active keyslots if no keyslot is specified)

Source

fn token_keyslot_is_assigned( &mut self, token_id: Luks2TokenId, keyslot: Keyslot, ) -> Result<bool>

Check whether a token is assigned to a given keyslot

Source

fn activate_with_token( &mut self, name: &str, token_id: Luks2TokenId, ) -> Result<Keyslot>

Activate the crypt device with the specified name and token

Source

fn check_activation_with_token( &mut self, token_id: Luks2TokenId, ) -> Result<Keyslot>

Check activation of a device with a token

Source

fn set_pbkdf_params( &mut self, type_: crypt_pbkdf_algo_type, hash: &str, time_ms: u32, iterations: u32, max_memory_kb: u32, parallel_threads: u32, ) -> Result<()>

Set PBKDF parameters (used during next keyslot registration)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§