[][src]Struct libcryptsetup_rs::CryptKeyslot

pub struct CryptKeyslot<'a> { /* fields omitted */ }

Handle for keyslot operations

Implementations

impl<'a> CryptKeyslot<'a>[src]

pub fn add_by_passphrase(
    &mut self,
    keyslot: Option<c_uint>,
    passphrase: &[u8],
    new_passphrase: &[u8]
) -> Result<c_uint, LibcryptErr>
[src]

Add key slot using a passphrase

pub fn change_by_passphrase(
    &mut self,
    keyslot_old: Option<c_uint>,
    keyslot_new: Option<c_uint>,
    passphrase: &[u8],
    new_passphrase: &[u8]
) -> Result<c_int, LibcryptErr>
[src]

Change allocated key slot using a passphrase

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>
[src]

Add key slot using key file

pub fn add_by_key(
    &mut self,
    keyslot: Option<c_uint>,
    volume_key: Option<&[u8]>,
    passphrase: &[u8],
    flags: CryptVolumeKeyFlags
) -> Result<c_uint, LibcryptErr>
[src]

Add key slot with a key

pub fn destroy(&mut self, keyslot: c_uint) -> Result<(), LibcryptErr>[src]

Destroy key slot

pub fn status(&mut self, keyslot: c_uint) -> Result<KeyslotInfo, LibcryptErr>[src]

Get keyslot status

pub fn get_priority(
    &mut self,
    keyslot: c_uint
) -> Result<KeyslotPriority, LibcryptErr>
[src]

Get keyslot priority (LUKS2 specific)

pub fn set_priority(
    &mut self,
    keyslot: c_uint,
    priority: KeyslotPriority
) -> Result<(), LibcryptErr>
[src]

Get keyslot priority (LUKS2 specific)

pub fn max_keyslots(fmt: EncryptionFormat) -> Result<c_uint, LibcryptErr>[src]

Get maximum keyslots supported for device type

pub fn area(&mut self, keyslot: c_uint) -> Result<(u64, u64), LibcryptErr>[src]

Get keyslot area pointers

pub fn get_key_size(&mut self, keyslot: c_uint) -> Result<c_uint, LibcryptErr>[src]

Get size of key in keyslot - only different from crypt_get_volume_key_size() binding in the case of LUKS2 using unbound keyslots

pub fn get_encryption(
    &mut self,
    keyslot: Option<c_uint>
) -> Result<(&str, size_t), LibcryptErr>
[src]

Get encryption cipher and key size of keyslot (not data)

pub fn get_pbkdf(
    &mut self,
    keyslot: c_uint
) -> Result<CryptPbkdfType, LibcryptErr>
[src]

Get PBDKF parameters for a keyslot

pub fn set_encryption(
    &mut self,
    cipher: &str,
    key_size: size_t
) -> Result<(), LibcryptErr>
[src]

Set encryption used for keyslot

pub fn get_dir() -> Result<Box<Path>, LibcryptErr>[src]

Get directory where crypt devices are mapped

Auto Trait Implementations

impl<'a> RefUnwindSafe for CryptKeyslot<'a>

impl<'a> !Send for CryptKeyslot<'a>

impl<'a> !Sync for CryptKeyslot<'a>

impl<'a> Unpin for CryptKeyslot<'a>

impl<'a> !UnwindSafe for CryptKeyslot<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.