Constructor
new DriveConfig()
Construct a class that hosts the properties of the drive config file
Classes
Methods
clear()
Clear properties.
getEncryptedData() → {Uint8Array}
Get encrypted data using the master key: drive key, hash key, drive id.
Returns:
The encrypted data
- Type
- Uint8Array
getHashSignature() → {Uint8Array}
Get the hash signature that was used to sign this drive configuration.
Returns:
The hash signature
- Type
- Uint8Array
getIterations() → {number}
Get the iterations to be used for the key derivation.
Returns:
The number of iterations
- Type
- number
getIv() → {Uint8Array}
Get the initial vector that was used to encrypt this drive configuration.
Returns:
The initial vector
- Type
- Uint8Array
getMagicBytes() → {Uint8Array}
Get the magic bytes from the config file.
Returns:
The magic bytes
- Type
- Uint8Array
getSalt() → {Uint8Array}
Get the salt to be used for the password key derivation.
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 |
(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 |