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§
- Luks2
Format Integrity - equivalent to
raw::crypt_params_integrity(with omitted params for constants) - Luks2
Format Pbkdf - equivalent to
raw::crypt_pbkdf_type - Luks2
Token Handler Box - In-memory representation of handler (needed because cryptsetup doesn’t copy the handler struct)
Enums§
Traits§
- Luks2
Token Handler - Equivalence trait for
raw::crypt_token_handler - Luks2
Token Handler Raw - Companion trait to
Luks2TokenHandlerwhich 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
libcryptsetupsees 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_ time Deprecated - Set the number of milliseconds for
PBKDF2function 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
- Luks2
Token Id - RawDevice
- Raw pointer to the underlying
crypt_deviceopaque struct - Result