Struct libcryptsetup_rs::CryptKeyslotHandle
source · 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<&[u8]>,
passphrase: &[u8],
flags: CryptVolumeKey
) -> Result<c_uint, LibcryptErr>
pub fn add_by_key( &mut self, keyslot: Option<c_uint>, volume_key: Option<&[u8]>, 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