pub struct CryptKeyslotHandle<'a> { /* private fields */ }
Expand description
Handle for keyslot operations
Implementations§
Source§impl<'a> CryptKeyslotHandle<'a>
impl<'a> CryptKeyslotHandle<'a>
Sourcepub fn add_by_passphrase(
&mut self,
keyslot: Option<c_uint>,
passphrase: &[u8],
new_passphrase: &[u8],
) -> Result<c_uint, LibcryptErr>
pub fn add_by_passphrase( &mut self, keyslot: Option<c_uint>, passphrase: &[u8], new_passphrase: &[u8], ) -> Result<c_uint, LibcryptErr>
Add key slot using a passphrase
Sourcepub fn change_by_passphrase(
&mut self,
keyslot_old: Option<c_uint>,
keyslot_new: Option<c_uint>,
passphrase: &[u8],
new_passphrase: &[u8],
) -> Result<c_uint, LibcryptErr>
pub fn change_by_passphrase( &mut self, keyslot_old: Option<c_uint>, keyslot_new: Option<c_uint>, passphrase: &[u8], new_passphrase: &[u8], ) -> Result<c_uint, LibcryptErr>
Change allocated key slot using a passphrase
Sourcepub fn add_by_keyfile_device_offset(
&mut self,
keyslot: Option<c_uint>,
keyfile_and_size: (&Path, size_t),
keyfile_offset: u64,
new_keyfile_and_size: (&Path, size_t),
new_keyfile_offset: u64,
) -> Result<c_uint, LibcryptErr>
pub fn add_by_keyfile_device_offset( &mut self, keyslot: Option<c_uint>, keyfile_and_size: (&Path, size_t), keyfile_offset: u64, new_keyfile_and_size: (&Path, size_t), new_keyfile_offset: u64, ) -> Result<c_uint, LibcryptErr>
Add key slot using key file
Sourcepub fn add_by_key(
&mut self,
keyslot: Option<c_uint>,
volume_key: Option<Either<&[u8], usize>>,
passphrase: &[u8],
flags: CryptVolumeKey,
) -> Result<c_uint, LibcryptErr>
pub fn add_by_key( &mut self, keyslot: Option<c_uint>, volume_key: Option<Either<&[u8], usize>>, passphrase: &[u8], flags: CryptVolumeKey, ) -> Result<c_uint, LibcryptErr>
Add key slot with a key
Sourcepub fn status(&mut self, keyslot: c_uint) -> Result<KeyslotInfo, LibcryptErr>
pub fn status(&mut self, keyslot: c_uint) -> Result<KeyslotInfo, LibcryptErr>
Get keyslot status
Sourcepub fn get_priority(
&mut self,
keyslot: c_uint,
) -> Result<KeyslotPriority, LibcryptErr>
pub fn get_priority( &mut self, keyslot: c_uint, ) -> Result<KeyslotPriority, LibcryptErr>
Get keyslot priority (LUKS2 specific)
Sourcepub fn set_priority(
&mut self,
keyslot: c_uint,
priority: KeyslotPriority,
) -> Result<(), LibcryptErr>
pub fn set_priority( &mut self, keyslot: c_uint, priority: KeyslotPriority, ) -> Result<(), LibcryptErr>
Get keyslot priority (LUKS2 specific)
Sourcepub fn max_keyslots(fmt: EncryptionFormat) -> Result<c_uint, LibcryptErr>
pub fn max_keyslots(fmt: EncryptionFormat) -> Result<c_uint, LibcryptErr>
Get maximum keyslots supported for device type
Sourcepub fn area(&mut self, keyslot: c_uint) -> Result<(u64, u64), LibcryptErr>
pub fn area(&mut self, keyslot: c_uint) -> Result<(u64, u64), LibcryptErr>
Get keyslot area pointers
Sourcepub fn get_key_size(&mut self, keyslot: c_uint) -> Result<c_uint, LibcryptErr>
pub fn get_key_size(&mut self, keyslot: c_uint) -> Result<c_uint, LibcryptErr>
Get size of key in keyslot - only different from crypt_get_volume_key_size()
binding
in the case of LUKS2 using unbound keyslots
Sourcepub fn get_encryption(
&mut self,
keyslot: Option<c_uint>,
) -> Result<(&str, size_t), LibcryptErr>
pub fn get_encryption( &mut self, keyslot: Option<c_uint>, ) -> Result<(&str, size_t), LibcryptErr>
Get encryption cipher and key size of keyslot (not data)
Sourcepub fn get_pbkdf(
&mut self,
keyslot: c_uint,
) -> Result<CryptPbkdfType, LibcryptErr>
pub fn get_pbkdf( &mut self, keyslot: c_uint, ) -> Result<CryptPbkdfType, LibcryptErr>
Get PBDKF parameters for a keyslot
Sourcepub fn set_encryption(
&mut self,
cipher: &str,
key_size: size_t,
) -> Result<(), LibcryptErr>
pub fn set_encryption( &mut self, cipher: &str, key_size: size_t, ) -> Result<(), LibcryptErr>
Set encryption used for keyslot
Auto Trait Implementations§
impl<'a> Freeze for CryptKeyslotHandle<'a>
impl<'a> RefUnwindSafe for CryptKeyslotHandle<'a>
impl<'a> !Send for CryptKeyslotHandle<'a>
impl<'a> !Sync for CryptKeyslotHandle<'a>
impl<'a> Unpin for CryptKeyslotHandle<'a>
impl<'a> !UnwindSafe for CryptKeyslotHandle<'a>
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