pub struct CryptLuks2TokenHandle<'a> { /* private fields */ }
Expand description
Handle for LUKS2 token operations
Implementations§
Source§impl<'a> CryptLuks2TokenHandle<'a>
impl<'a> CryptLuks2TokenHandle<'a>
Sourcepub fn json_get(&mut self, token: c_uint) -> Result<Value, LibcryptErr>
pub fn json_get(&mut self, token: c_uint) -> Result<Value, LibcryptErr>
Get contents of a token in JSON format
Sourcepub fn json_set(&mut self, input: TokenInput<'_>) -> Result<c_uint, LibcryptErr>
pub fn json_set(&mut self, input: TokenInput<'_>) -> Result<c_uint, LibcryptErr>
Set contents of a token in JSON format
Sourcepub fn status(&mut self, token: c_uint) -> Result<CryptTokenInfo, LibcryptErr>
pub fn status(&mut self, token: c_uint) -> Result<CryptTokenInfo, LibcryptErr>
Get the token info for a specific token
Sourcepub fn luks2_keyring_set(
&mut self,
token: Option<c_uint>,
key_description: &str,
) -> Result<c_uint, LibcryptErr>
pub fn luks2_keyring_set( &mut self, token: Option<c_uint>, key_description: &str, ) -> Result<c_uint, LibcryptErr>
Create new LUKS2 keyring token
Sourcepub fn luks2_keyring_get(
&mut self,
token: c_uint,
) -> Result<String, LibcryptErr>
pub fn luks2_keyring_get( &mut self, token: c_uint, ) -> Result<String, LibcryptErr>
Get LUKS2 keyring token description
Sourcepub fn assign_keyslot(
&mut self,
token: c_uint,
keyslot: Option<c_uint>,
) -> Result<(), LibcryptErr>
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
Sourcepub fn unassign_keyslot(
&mut self,
token: c_uint,
keyslot: Option<c_uint>,
) -> Result<(), LibcryptErr>
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
Sourcepub fn is_assigned(
&mut self,
token: c_uint,
keyslot: c_uint,
) -> Result<bool, LibcryptErr>
pub fn is_assigned( &mut self, token: c_uint, keyslot: c_uint, ) -> Result<bool, LibcryptErr>
Check if token is assigned
Sourcepub fn activate_by_token<T>(
&mut self,
name: Option<&str>,
token: Option<c_uint>,
usrdata: Option<&mut T>,
flags: CryptActivate,
) -> Result<c_uint, LibcryptErr>
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§
impl<'a> Freeze for CryptLuks2TokenHandle<'a>
impl<'a> RefUnwindSafe for CryptLuks2TokenHandle<'a>
impl<'a> !Send for CryptLuks2TokenHandle<'a>
impl<'a> !Sync for CryptLuks2TokenHandle<'a>
impl<'a> Unpin for CryptLuks2TokenHandle<'a>
impl<'a> !UnwindSafe for CryptLuks2TokenHandle<'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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more