pub struct CryptLuks2TokenHandle<'a> { /* private fields */ }
Expand description

Handle for LUKS2 token operations

Implementations§

source§

impl<'a> CryptLuks2TokenHandle<'a>

source

pub fn json_get(&mut self, token: c_uint) -> Result<Value, LibcryptErr>

Get contents of a token in JSON format

source

pub fn json_set(&mut self, input: TokenInput<'_>) -> Result<c_uint, LibcryptErr>

Set contents of a token in JSON format

source

pub fn status(&mut self, token: c_uint) -> Result<CryptTokenInfo, LibcryptErr>

Get the token info for a specific token

source

pub fn luks2_keyring_set( &mut self, token: Option<c_uint>, key_description: &str ) -> Result<c_uint, LibcryptErr>

Create new LUKS2 keyring token

source

pub fn luks2_keyring_get( &mut self, token: c_uint ) -> Result<String, LibcryptErr>

Get LUKS2 keyring token description

source

pub fn assign_keyslot( &mut self, token: c_uint, keyslot: Option<c_uint> ) -> Result<(), LibcryptErr>

Assign token to keyslot

None for keyslot assigns all keyslots to the token

source

pub fn unassign_keyslot( &mut self, token: c_uint, keyslot: Option<c_uint> ) -> Result<(), LibcryptErr>

Unassign token from keyslot

None for keyslot unassigns the token from all active keyslots

source

pub fn is_assigned( &mut self, token: c_uint, keyslot: c_uint ) -> Result<bool, LibcryptErr>

Check if token is assigned

source

pub fn activate_by_token<T>( &mut self, name: Option<&str>, token: Option<c_uint>, usrdata: Option<&mut T>, flags: CryptActivate ) -> Result<c_uint, LibcryptErr>

Activate device or check key using a token

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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.