[][src]Trait cryptsetup_rs::api::Luks2CryptDevice

pub trait Luks2CryptDevice: LuksCryptDevice {
    fn register_new_token_handler<Handler: Luks2TokenHandlerRaw>(
    ) -> Result<Luks2TokenHandlerBox<Handler>>;
fn register_token_handler<Handler: Luks2TokenHandlerRaw>(
        handler: &Luks2TokenHandlerBox<Handler>
    ) -> Result<()>;
fn token_status(
        &mut self,
        token_id: Luks2TokenId
    ) -> (crypt_token_info, Option<String>);
fn get_token(&mut self, token_id: Luks2TokenId) -> Result<Luks2Token>;
fn add_token_with_id(
        &mut self,
        token: &Luks2Token,
        token_id: Luks2TokenId
    ) -> Result<()>;
fn add_token(&mut self, token: &Luks2Token) -> Result<Luks2TokenId>;
fn remove_token(&mut self, token_id: Luks2TokenId) -> Result<()>;
fn assign_token_to_keyslot(
        &mut self,
        token_id: Luks2TokenId,
        keyslot_opt: Option<Keyslot>
    ) -> Result<()>;
fn unassign_token_keyslot(
        &mut self,
        token_id: Luks2TokenId,
        keyslot_opt: Option<Keyslot>
    ) -> Result<()>;
fn token_keyslot_is_assigned(
        &mut self,
        token_id: Luks2TokenId,
        keyslot: Keyslot
    ) -> Result<bool>;
fn activate_with_token(
        &mut self,
        name: &str,
        token_id: Luks2TokenId
    ) -> Result<Keyslot>;
fn check_activation_with_token(
        &mut self,
        token_id: Luks2TokenId
    ) -> Result<Keyslot>; }

Trait representing specific operations on a LUKS2 device

Required methods

fn register_new_token_handler<Handler: Luks2TokenHandlerRaw>(
) -> Result<Luks2TokenHandlerBox<Handler>>

Register a LUKS2 token handler

fn register_token_handler<Handler: Luks2TokenHandlerRaw>(
    handler: &Luks2TokenHandlerBox<Handler>
) -> Result<()>

Register a LUKS2 token handler given a reference to it

fn token_status(
    &mut self,
    token_id: Luks2TokenId
) -> (crypt_token_info, Option<String>)

Get token status for a given token id

fn get_token(&mut self, token_id: Luks2TokenId) -> Result<Luks2Token>

Get a token by id

fn add_token_with_id(
    &mut self,
    token: &Luks2Token,
    token_id: Luks2TokenId
) -> Result<()>

Add a token with a specific id

fn add_token(&mut self, token: &Luks2Token) -> Result<Luks2TokenId>

Add a token, returning the allocated token id

fn remove_token(&mut self, token_id: Luks2TokenId) -> Result<()>

Remove a token by id

fn assign_token_to_keyslot(
    &mut self,
    token_id: Luks2TokenId,
    keyslot_opt: Option<Keyslot>
) -> Result<()>

Assign a token id to a keyslot (or all active keyslots if no keyslot is specified)

fn unassign_token_keyslot(
    &mut self,
    token_id: Luks2TokenId,
    keyslot_opt: Option<Keyslot>
) -> Result<()>

Unassing a token from a keyslot (or all active keyslots if no keyslot is specified)

fn token_keyslot_is_assigned(
    &mut self,
    token_id: Luks2TokenId,
    keyslot: Keyslot
) -> Result<bool>

Check whether a token is assigned to a given keyslot

fn activate_with_token(
    &mut self,
    name: &str,
    token_id: Luks2TokenId
) -> Result<Keyslot>

Activate the crypt device with the specified name and token

fn check_activation_with_token(
    &mut self,
    token_id: Luks2TokenId
) -> Result<Keyslot>

Check activation of a device with a token

Loading content...

Implementors

impl Luks2CryptDevice for CryptDeviceHandle<Luks2Params>[src]

Loading content...