Module device

Module device 

Source
Expand description

Low-level cryptsetup binding that sits directly on top of the libcryptsetup C API

Consider using the high-level binding in the api module instead

Structs§

Luks2FormatIntegrity
equivalent to raw::crypt_params_integrity (with omitted params for constants)
Luks2FormatPbkdf
equivalent to raw::crypt_pbkdf_type
Luks2TokenHandlerBox
In-memory representation of handler (needed because cryptsetup doesn’t copy the handler struct)

Enums§

Error
TokenHandlerResult

Traits§

Luks2TokenHandler
Equivalence trait for raw::crypt_token_handler
Luks2TokenHandlerRaw
Companion trait to Luks2TokenHandler which contains the raw FFI implementation. Users should implement this trait but not override the implementation.

Functions§

cipher
Get the cipher used by this crypt device
cipher_mode
Get the cipher mode used by this crypt device
cryptsetup_rs_log_callback
Log function callback used by libcryptsetup
deactivate
Deactivate crypt device, removing active device-mapper mapping from kernel.
device_name
Get the path to the device (as libcryptsetup sees it)
dump
Dump text-formatted information about this device to the console
free
Releases crypt device context and memory
init
Initialise crypt device and check if provided device exists
init_by_name
Initialise active crypt device by name (and error out if inactive)
init_detached_header
Initialise crypt device by header device and data device, and check if provided device exists
keyslot_status
Get information about a keyslot
load
Load crypt device parameters from the on-disk header
luks1_format
Format a new crypt device as LUKS1 but do not activate it
luks2_activate_by_token
Activate device, or when name is not provided, check the key can open the device
luks2_format
Format a new crypt device as LUKS2 but do not activate it
luks2_register_token_handler
Register a LUKS2 token handler
luks2_set_pbkdf_type
luks2_token_assign_keyslot
Assigns a token id to a keyslot (or, if no keyslot is specified, all active keyslots)
luks2_token_is_assigned
Get information about token assignment for a particular keyslot
luks2_token_json
Get the token’s JSON value for a token id
luks2_token_json_allocate
Set the token’s JSON value and allocate it to a token id (new token id will be allocated if no token id is passed)
luks2_token_remove
Removes a token by its id
luks2_token_status
Get the status of LUKS2 token id (and if successful, the type name of the token)
luks2_token_unassign_keyslot
Unassigns a token id from a keyslot (or, if no keyslot is specified, all active keyslots)
luks_activate
Activate device based on provided key (“passphrase”)
luks_add_keyslot
Add key slot using provided passphrase. If there is no previous passphrase, use the volume key that is in-memory to add the new key slot.
luks_destroy_keyslot
Destroy (and disable) key slot
luks_update_keyslot
Add key slot using provided passphrase.
rng_type
Get which RNG is used
set_iteration_timeDeprecated
Set the number of milliseconds for PBKDF2 function iteration
set_rng_type
Set which RNG is used
status
Get status info about a device name
status_only
Get status info about a device name (only)
uuid
Get device UUID
volume_key_size
Get size in bytes of the volume key

Type Aliases§

Keyslot
Luks2TokenId
RawDevice
Raw pointer to the underlying crypt_device opaque struct
Result