Class: DriveConfig

DriveConfig()

Represents a configuration file for a drive. The properties are encrypted in the file with a master key which is password derived.

Constructor

new DriveConfig()

Construct a class that hosts the properties of the drive config file
Source:

Classes

DriveConfig

Methods

clear()

Clear properties.
Source:

getEncryptedData() → {Uint8Array}

Get encrypted data using the master key: drive key, hash key, drive id.
Source:
Returns:
The encrypted data
Type
Uint8Array

getHashSignature() → {Uint8Array}

Get the hash signature that was used to sign this drive configuration.
Source:
Returns:
The hash signature
Type
Uint8Array

getIterations() → {number}

Get the iterations to be used for the key derivation.
Source:
Returns:
The number of iterations
Type
number

getIv() → {Uint8Array}

Get the initial vector that was used to encrypt this drive configuration.
Source:
Returns:
The initial vector
Type
Uint8Array

getMagicBytes() → {Uint8Array}

Get the magic bytes from the config file.
Source:
Returns:
The magic bytes
Type
Uint8Array

getSalt() → {Uint8Array}

Get the salt to be used for the password key derivation.
Source:
Returns:
the salt
Type
Uint8Array

(async) init(contents)

Initializes the properties of the drive config file
Parameters:
Name Type Description
contents Uint8Array The byte array that contains the contents of the config file
Source:

(async, static) writeDriveConfig(configFile, magicBytes, version, salt, iterations, keyIv, encryptedData, hashSignature)

Write the properties of a drive to a config file
Parameters:
Name Type Description
configFile IFile The configuration file that will be used to write the content into
magicBytes Uint8Array The magic bytes for the header
version number The version of the file format
salt Uint8Array The salt that will be used for encryption of the combined key
iterations number The iteration that will be used to derive the master key from a text password
keyIv Uint8Array The initial vector that was used with the master password to encrypt the combined key
encryptedData Uint8Array The encrypted combined key and drive id
hashSignature Uint8Array The hash signature of the drive id
Source: