Skip to main content

LuksVolume

Struct LuksVolume 

Source
pub struct LuksVolume;
Expand description

Namespace for opening a LUKS volume. State lives in DecryptedPayload.

Implementations§

Source§

impl LuksVolume

Source

pub fn unlock_with_passphrase<R: Read + Seek>( reader: R, passphrase: &[u8], ) -> Result<DecryptedPayload<R>>

Unlock a LUKS1 or LUKS2 container, auto-detecting the version from the header.

§Errors

See Self::unlock1_with_passphrase / Self::unlock2_with_passphrase.

Source

pub fn unlock1_with_passphrase<R: Read + Seek>( reader: R, passphrase: &[u8], ) -> Result<DecryptedPayload<R>>

Unlock a LUKS1 container from reader with passphrase.

§Errors

Header-parse errors, LuksError::NoActiveKeyslot, or LuksError::AuthenticationFailed on a wrong passphrase.

Source

pub fn unlock2_with_passphrase<R: Read + Seek>( reader: R, passphrase: &[u8], ) -> Result<DecryptedPayload<R>>

Unlock a LUKS2 container from reader with passphrase.

§Errors

Header/JSON-parse errors, LuksError::NoActiveKeyslot if there is no crypt segment or keyslot, or LuksError::AuthenticationFailed.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.