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§
Sourcefn register_new_token_handler<Handler: Luks2TokenHandlerRaw>() -> Result<Luks2TokenHandlerBox<Handler>>
fn register_new_token_handler<Handler: Luks2TokenHandlerRaw>() -> Result<Luks2TokenHandlerBox<Handler>>
Register a LUKS2 token handler
Sourcefn register_token_handler<Handler: Luks2TokenHandlerRaw>(
handler: &Luks2TokenHandlerBox<Handler>,
) -> Result<()>
fn register_token_handler<Handler: Luks2TokenHandlerRaw>( handler: &Luks2TokenHandlerBox<Handler>, ) -> Result<()>
Register a LUKS2 token handler given a reference to it
Sourcefn token_status(
&mut self,
token_id: Luks2TokenId,
) -> (crypt_token_info, Option<String>)
fn token_status( &mut self, token_id: Luks2TokenId, ) -> (crypt_token_info, Option<String>)
Get token status for a given token id
Sourcefn get_token(&mut self, token_id: Luks2TokenId) -> Result<Luks2Token>
fn get_token(&mut self, token_id: Luks2TokenId) -> Result<Luks2Token>
Get a token by id
Sourcefn add_token_with_id(
&mut self,
token: &Luks2Token,
token_id: Luks2TokenId,
) -> Result<()>
fn add_token_with_id( &mut self, token: &Luks2Token, token_id: Luks2TokenId, ) -> Result<()>
Add a token with a specific id
Sourcefn add_token(&mut self, token: &Luks2Token) -> Result<Luks2TokenId>
fn add_token(&mut self, token: &Luks2Token) -> Result<Luks2TokenId>
Add a token, returning the allocated token id
Sourcefn remove_token(&mut self, token_id: Luks2TokenId) -> Result<()>
fn remove_token(&mut self, token_id: Luks2TokenId) -> Result<()>
Remove a token by id
Sourcefn assign_token_to_keyslot(
&mut self,
token_id: Luks2TokenId,
keyslot_opt: Option<Keyslot>,
) -> Result<()>
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)
Sourcefn unassign_token_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<()>
Unassing a token from a keyslot (or all active keyslots if no keyslot is specified)
Sourcefn token_keyslot_is_assigned(
&mut self,
token_id: Luks2TokenId,
keyslot: Keyslot,
) -> Result<bool>
fn token_keyslot_is_assigned( &mut self, token_id: Luks2TokenId, keyslot: Keyslot, ) -> Result<bool>
Check whether a token is assigned to a given keyslot
Sourcefn activate_with_token(
&mut self,
name: &str,
token_id: Luks2TokenId,
) -> Result<Keyslot>
fn activate_with_token( &mut self, name: &str, token_id: Luks2TokenId, ) -> Result<Keyslot>
Activate the crypt device with the specified name and token
Sourcefn check_activation_with_token(
&mut self,
token_id: Luks2TokenId,
) -> Result<Keyslot>
fn check_activation_with_token( &mut self, token_id: Luks2TokenId, ) -> Result<Keyslot>
Check activation of a device with a token
Sourcefn 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<()>
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".