pub struct CryptDeviceHandle<P: Debug> { /* private fields */ }
Expand description
An opaque handle on an initialized crypt device
Trait Implementations§
Source§impl<P: Debug> CryptDevice for CryptDeviceHandle<P>
impl<P: Debug> CryptDevice for CryptDeviceHandle<P>
Source§fn cipher_mode(&self) -> &str
fn cipher_mode(&self) -> &str
Name of cipher mode used
Source§fn device_name(&self) -> &str
fn device_name(&self) -> &str
Path to the underlying device (as reported by
libcryptsetup
)Source§fn rng_type(&self) -> crypt_rng_type
fn rng_type(&self) -> crypt_rng_type
Random number generator used for operations on this crypt device
Source§fn set_rng_type(&mut self, rng_type: crypt_rng_type)
fn set_rng_type(&mut self, rng_type: crypt_rng_type)
Sets the random number generator to use
Source§fn set_iteration_time(&mut self, iteration_time_ms: u64)
fn set_iteration_time(&mut self, iteration_time_ms: u64)
Sets the iteration time for the
PBKDF2
function. Note that this does not affect the MK iterations.Source§fn volume_key_size(&self) -> u8
fn volume_key_size(&self) -> u8
Volume key size (in bytes)
Source§impl CryptDeviceType for CryptDeviceHandle<Luks1Params>
impl CryptDeviceType for CryptDeviceHandle<Luks1Params>
Source§fn device_type(&self) -> crypt_device_type
fn device_type(&self) -> crypt_device_type
Type of the crypt device
Source§impl CryptDeviceType for CryptDeviceHandle<Luks2Params>
impl CryptDeviceType for CryptDeviceHandle<Luks2Params>
Source§fn device_type(&self) -> crypt_device_type
fn device_type(&self) -> crypt_device_type
Type of the crypt device
Source§impl<P: Debug> Debug for CryptDeviceHandle<P>
impl<P: Debug> Debug for CryptDeviceHandle<P>
Source§impl<P: Debug> Drop for CryptDeviceHandle<P>
impl<P: Debug> Drop for CryptDeviceHandle<P>
Source§impl Luks1CryptDevice for CryptDeviceHandle<Luks1Params>
impl Luks1CryptDevice for CryptDeviceHandle<Luks1Params>
Source§fn mk_iterations(&self) -> u32
fn mk_iterations(&self) -> u32
Master key
PBKDF2
iterationsSource§fn payload_offset(&self) -> u32
fn payload_offset(&self) -> u32
Get the offset of the payload
Source§impl Luks2CryptDevice for CryptDeviceHandle<Luks2Params>
impl Luks2CryptDevice for CryptDeviceHandle<Luks2Params>
Source§fn register_new_token_handler<Handler: Luks2TokenHandlerRaw>() -> Result<Luks2TokenHandlerBox<Handler>>
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<()>
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>)
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>
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<()>
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>
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<()>
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<()>
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<()>
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>
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>
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>
fn check_activation_with_token( &mut self, token_id: Luks2TokenId, ) -> Result<Keyslot>
Check activation of a device with a token
Source§impl LuksCryptDevice for CryptDeviceHandle<Luks1Params>
impl LuksCryptDevice for CryptDeviceHandle<Luks1Params>
Source§fn activate(&mut self, name: &str, key: &[u8]) -> Result<Keyslot>
fn activate(&mut self, name: &str, key: &[u8]) -> Result<Keyslot>
Activate the crypt device, and give it the specified name
Source§fn deactivate(self, name: &str) -> Result<()>
fn deactivate(self, name: &str) -> Result<()>
Deactivate the crypt device, remove the device-mapper mapping and key information from kernel
Source§fn keyslot_status(&self, keyslot: Keyslot) -> crypt_keyslot_info
fn keyslot_status(&self, keyslot: Keyslot) -> crypt_keyslot_info
Get status of key slot
Source§impl LuksCryptDevice for CryptDeviceHandle<Luks2Params>
impl LuksCryptDevice for CryptDeviceHandle<Luks2Params>
Source§fn activate(&mut self, name: &str, key: &[u8]) -> Result<u8>
fn activate(&mut self, name: &str, key: &[u8]) -> Result<u8>
Activate the crypt device, and give it the specified name
Source§fn deactivate(self, name: &str) -> Result<()>
fn deactivate(self, name: &str) -> Result<()>
Deactivate the crypt device, remove the device-mapper mapping and key information from kernel
Source§fn keyslot_status(&self, keyslot: Keyslot) -> crypt_keyslot_info
fn keyslot_status(&self, keyslot: Keyslot) -> crypt_keyslot_info
Get status of key slot
impl<P: Debug> StructuralPartialEq for CryptDeviceHandle<P>
Auto Trait Implementations§
impl<P> Freeze for CryptDeviceHandle<P>where
P: Freeze,
impl<P> RefUnwindSafe for CryptDeviceHandle<P>where
P: RefUnwindSafe,
impl<P> !Send for CryptDeviceHandle<P>
impl<P> !Sync for CryptDeviceHandle<P>
impl<P> Unpin for CryptDeviceHandle<P>where
P: Unpin,
impl<P> UnwindSafe for CryptDeviceHandle<P>where
P: UnwindSafe,
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more