[−][src]Struct libcryptsetup_rs::CryptContext
Cryptographic context for device
Implementations
impl<'a> CryptContext<'a>
[src]
pub fn format<T>(
&mut self,
type_: EncryptionFormat,
cipher_and_mode: (&str, &str),
uuid: Option<Uuid>,
volume_key: Either<&[u8], usize>,
params: Option<&mut T>
) -> Result<(), LibcryptErr>
[src]
&mut self,
type_: EncryptionFormat,
cipher_and_mode: (&str, &str),
uuid: Option<Uuid>,
volume_key: Either<&[u8], usize>,
params: Option<&mut T>
) -> Result<(), LibcryptErr>
Format and encrypt the given device with the requested encryption algorithm and key or key length.
For volume_key
parameter, either the volume key or the desired length of
the generated volume key can be specified.
For the volume_key
parameter, the value in Either::Right
must be in
units of bytes. For a common key length such as 512 bits, the value passed
to the Either::Right
variant would be 512 / 8
.
pub fn convert<T>(
&mut self,
type_: EncryptionFormat,
params: &mut T
) -> Result<(), LibcryptErr>
[src]
&mut self,
type_: EncryptionFormat,
params: &mut T
) -> Result<(), LibcryptErr>
Convert to new format type
pub fn set_uuid(&mut self, uuid: Option<Uuid>) -> Result<(), LibcryptErr>
[src]
Set UUID of crypt device
pub fn set_label(
&mut self,
label: Option<&str>,
subsystem_label: Option<&str>
) -> Result<(), LibcryptErr>
[src]
&mut self,
label: Option<&str>,
subsystem_label: Option<&str>
) -> Result<(), LibcryptErr>
Set LUKS2 device label
pub fn volume_key_keyring(&mut self, enable: Bool) -> Result<(), LibcryptErr>
[src]
Set policty on loading volume keys via kernel keyring
pub fn load<T>(
&mut self,
type_: Option<EncryptionFormat>,
params: Option<&mut T>
) -> Result<(), LibcryptErr>
[src]
&mut self,
type_: Option<EncryptionFormat>,
params: Option<&mut T>
) -> Result<(), LibcryptErr>
Load on-disk header parameters based on provided type
pub fn repair<T>(
&mut self,
type_: EncryptionFormat,
params: &mut T
) -> Result<(), LibcryptErr>
[src]
&mut self,
type_: EncryptionFormat,
params: &mut T
) -> Result<(), LibcryptErr>
Repair crypt device header if invalid
pub fn resize(&mut self, name: &str, new_size: u64) -> Result<(), LibcryptErr>
[src]
Resize crypt device
pub fn suspend(&mut self, name: &str) -> Result<(), LibcryptErr>
[src]
Suspend crypt device
pub fn resume_by_passphrase(
&mut self,
name: &str,
keyslot: c_int,
passphrase: &str
) -> Result<c_int, LibcryptErr>
[src]
&mut self,
name: &str,
keyslot: c_int,
passphrase: &str
) -> Result<c_int, LibcryptErr>
Resume crypt device using a passphrase
pub fn resume_by_keyfile_device_offset(
&mut self,
name: &str,
keyslot: c_int,
keyfile: &Path,
keyfile_size: size_t,
keyfile_offset: u64
) -> Result<c_int, LibcryptErr>
[src]
&mut self,
name: &str,
keyslot: c_int,
keyfile: &Path,
keyfile_size: size_t,
keyfile_offset: u64
) -> Result<c_int, LibcryptErr>
Resume crypt device using a key file at an offset on disk
Auto Trait Implementations
impl<'a> RefUnwindSafe for CryptContext<'a>
impl<'a> !Send for CryptContext<'a>
impl<'a> !Sync for CryptContext<'a>
impl<'a> Unpin for CryptContext<'a>
impl<'a> !UnwindSafe for CryptContext<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,