cryptsetup API
Public cryptsetup API
Loading...
Searching...
No Matches
Macros | Functions
Function to read keyfile

Macros

#define CRYPT_KEYFILE_STOP_EOL   (UINT32_C(1) << 0)
 

Functions

int crypt_keyfile_device_read (struct crypt_device *cd, const char *keyfile, char **key, size_t *key_size_read, uint64_t keyfile_offset, size_t key_size, uint32_t flags)
 
int crypt_keyfile_read (struct crypt_device *cd, const char *keyfile, char **key, size_t *key_size_read, size_t keyfile_offset, size_t key_size, uint32_t flags)
 

Detailed Description

Macro Definition Documentation

◆ CRYPT_KEYFILE_STOP_EOL

#define CRYPT_KEYFILE_STOP_EOL   (UINT32_C(1) << 0)

Read key only to the first end of line (\n).

Function Documentation

◆ crypt_keyfile_device_read()

int crypt_keyfile_device_read ( struct crypt_device *  cd,
const char *  keyfile,
char **  key,
size_t *  key_size_read,
uint64_t  keyfile_offset,
size_t  key_size,
uint32_t  flags 
)

Read keyfile

Parameters
cdcrypt device handle
keyfilekeyfile to read
keybuffer for key
key_size_readsize of read key
keyfile_offsetkey offset in keyfile
key_sizeexact key length to read from file or 0
flagskeyfile read flags
Returns
0 on success or negative errno value otherwise.
Note
If key_size is set to zero we read internal max length and actual size read is returned via key_size_read parameter.

◆ crypt_keyfile_read()

int crypt_keyfile_read ( struct crypt_device *  cd,
const char *  keyfile,
char **  key,
size_t *  key_size_read,
size_t  keyfile_offset,
size_t  key_size,
uint32_t  flags 
)

Backward compatible crypt_keyfile_device_read() (with size_t offset).