dfvfs.credentials package

Submodules

dfvfs.credentials.apfs_credentials module

The Apple File System (APFS) credentials.

class dfvfs.credentials.apfs_credentials.APFSCredentials[source]

Bases: Credentials

Apple File System (APFS) credentials.

CREDENTIALS = frozenset({'password', 'recovery_password'})
TYPE_INDICATOR = 'APFS_CONTAINER'

dfvfs.credentials.bde_credentials module

The BitLocker Drive Encryption (BDE) credentials.

class dfvfs.credentials.bde_credentials.BDECredentials[source]

Bases: Credentials

BitLocker Drive Encryption (BDE) credentials.

CREDENTIALS = frozenset({'password', 'recovery_password', 'startup_key'})
TYPE_INDICATOR = 'BDE'

dfvfs.credentials.credentials module

The credentials interface.

class dfvfs.credentials.credentials.Credentials[source]

Bases: object

Credentials interface.

__init__()[source]

Initializes credentials.

Raises:

ValueError – if a derived credentials class does not define a type indicator.

property type_indicator

type indicator.

Type:

str

dfvfs.credentials.cs_credentials module

The Core Storage (CS) credentials.

class dfvfs.credentials.cs_credentials.CSCredentials[source]

Bases: Credentials

Core Storage (CS) credentials.

CREDENTIALS = frozenset({'encrypted_root_plist', 'password', 'recovery_password'})
TYPE_INDICATOR = 'CS'

dfvfs.credentials.encrypted_stream_credentials module

The encrypted stream credentials.

class dfvfs.credentials.encrypted_stream_credentials.EncryptedStreamCredentials[source]

Bases: Credentials

Encrypted stream credentials.

CREDENTIALS = frozenset({'cipher_mode', 'initialization_vector', 'key'})
TYPE_INDICATOR = 'ENCRYPTED_STREAM'

dfvfs.credentials.keychain module

The path specification key chain.

The key chain is used to manage credentials for path specifications. E.g. BitLocker Drive Encryption (BDE) encrypted volumes can require a credential (e.g. password) to access the unencrypted data (unlock).

class dfvfs.credentials.keychain.KeyChain[source]

Bases: object

Key chain.

Empty()[source]

Empties the key chain.

ExtractCredentialsFromPathSpec(path_spec)[source]

Extracts credentials from a path specification.

Parameters:

path_spec (PathSpec) – path specification to extract credentials from.

GetCredential(path_spec, identifier)[source]

Retrieves a specific credential from the key chain.

Parameters:
  • path_spec (PathSpec) – path specification.

  • identifier (str) – credential identifier.

Returns:

credential or None if the credential for the path specification

is not set.

Return type:

object

GetCredentials(path_spec)[source]

Retrieves all credentials for the path specification.

Parameters:

path_spec (PathSpec) – path specification.

Returns:

credentials for the path specification.

Return type:

dict[str,object]

SetCredential(path_spec, identifier, data)[source]

Sets a specific credential for the path specification.

Parameters:
  • path_spec (PathSpec) – path specification.

  • identifier (str) – credential identifier.

  • data (object) – credential data.

Raises:

KeyError – if the credential is not supported by the path specification type.

__init__()[source]

Initializes a key chain.

dfvfs.credentials.luksde_credentials module

The LUKS Drive Encryption credentials.

class dfvfs.credentials.luksde_credentials.LUKSDECredentials[source]

Bases: Credentials

LUKS Drive Encryption credentials.

CREDENTIALS = frozenset({'password'})
TYPE_INDICATOR = 'LUKSDE'

dfvfs.credentials.manager module

The path specification credentials manager.

The credentials manager uses credential (instances of Credentials) to specify which credentials a specific path specification type supports. E.g. in case of BitLocker Drive Encryption (BDE): * password; * recovery password; * startup key; * key data.

class dfvfs.credentials.manager.CredentialsManager[source]

Bases: object

Credentials manager.

classmethod DeregisterCredentials(credentials)[source]

Deregisters a path specification credentials.

Parameters:

credentials (Credentials) – credentials.

Raises:

KeyError – if credential object is not set for the corresponding type indicator.

classmethod GetCredentials(path_spec)[source]

Retrieves the credentials for a specific path specification.

Parameters:

path_spec (PathSpec) – path specification.

Returns:

credentials or None if the path specification has no

credentials support.

Return type:

Credentials

classmethod RegisterCredentials(credentials)[source]

Registers a path specification credentials.

Parameters:

credentials (Credentials) – credentials.

Raises:

KeyError – if credentials object is already set for the corresponding type indicator.

Module contents

Imports for the credential manager.