BlockDev.CryptoKeyslotContext

Fields

Name

Type

Access

Description

type

BlockDev.CryptoKeyslotContextType

r/w

Methods

class

new_keyfile (keyfile, keyfile_offset, key_size)

class

new_keyring (key_desc)

class

new_passphrase (pass_data)

class

new_volume_key (volume_key)

Details

class BlockDev.CryptoKeyslotContext
classmethod new_keyfile(keyfile, keyfile_offset, key_size)
Parameters:
  • keyfile (str) – a key file for the new context

  • keyfile_offset (int) – number of bytes to read from keyfile or 0 for unlimited

  • key_size (int) – number of bytes to skip at start of keyfile

Raises:

GLib.Error

Return type:

BlockDev.CryptoKeyslotContext

Returns (transfer full): new BlockDev.CryptoKeyslotContext initialized by key file or None in case of error

Tech category: always available

classmethod new_keyring(key_desc)
Parameters:

key_desc (str) – kernel BlockDev.keyring key description

Raises:

GLib.Error

Return type:

BlockDev.CryptoKeyslotContext

Returns (transfer full): new BlockDev.CryptoKeyslotContext initialized by key_desc or None in case of error

Note: Keyslot BlockDev.passphrase must be stored in ‘user’ key type and the key has to be reachable by process context on behalf of which this function is called.

Tech category: always available

classmethod new_passphrase(pass_data)
Parameters:

pass_data (bytes) – a BlockDev.passphrase for the new context (may contain arbitrary binary data)

Raises:

GLib.Error

Return type:

BlockDev.CryptoKeyslotContext

Returns (transfer full): new BlockDev.CryptoKeyslotContext initialized by BlockDev.passphrase or None in case of error

Tech category: always available

classmethod new_volume_key(volume_key)
Parameters:

volume_key (bytes) – a volume key for the new context (may contain arbitrary binary data)

Raises:

GLib.Error

Return type:

BlockDev.CryptoKeyslotContext

Returns (transfer full): new BlockDev.CryptoKeyslotContext initialized by volume key or None in case of error

Tech category: always available