pub trait Luks2TokenHandler {
    fn name() -> &'static str;
    fn open(
        cd: RawDevice,
        token_id: Luks2TokenId
    ) -> (Vec<u8>, TokenHandlerResult); fn free(buf: Vec<u8>); fn can_validate() -> bool; fn is_valid(cd: RawDevice, json: String) -> Option<TokenHandlerResult>; fn dump(cd: RawDevice, json: String); }
Expand description

Equivalence trait for raw::crypt_token_handler

The implementation makes use of traits to generate the raw C functions as a default trait implementation in Luks2TokenHandlerRaw. There isn’t really an alternative (safe) way to create the C functions because the libcryptsetup interface does not offer user pointers as parameters on all of the callback functions (eliminating the possibility of using boxed closures)

Required Methods

Display name of token handler

Return the key (the vector returned will be disowned and passed to the free function later)

Free the key (by passing it the reconstructed) vector

Whether the handler can validate json

Validate the token handler JSON representation

Dump debug information about the token handler implementation

Implementors