pub trait Luks2TokenHandler {
// Required methods
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§
Sourcefn open(cd: RawDevice, token_id: Luks2TokenId) -> (Vec<u8>, TokenHandlerResult)
fn open(cd: RawDevice, token_id: Luks2TokenId) -> (Vec<u8>, TokenHandlerResult)
Return the key (the vector returned will be disowned and passed to the free function later)
Sourcefn can_validate() -> bool
fn can_validate() -> bool
Whether the handler can validate json
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".