allow customising the source of dehydration key

This commit is contained in:
Bruno Windels 2020-11-04 16:51:45 +01:00
parent dbf2394668
commit 625e03cde3
2 changed files with 15 additions and 1 deletions

View file

@ -44,6 +44,13 @@ function getSecretStorageKey(): Uint8Array {
return null;
}
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
function getDehydrationKey(
keyInfo: ISecretStorageKeyInfo,
): Promise<Uint8Array> {
return Promise.resolve(null);
}
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
function catchAccessSecretStorageError(e: Error): void {
// E.g. notify the user in some way
@ -74,6 +81,9 @@ export interface ISecurityCustomisations {
setupEncryptionNeeded?: (
kind: SetupEncryptionKind,
) => boolean,
getDehydrationKey?: (
keyInfo: ISecretStorageKeyInfo,
) => Promise<Uint8Array>,
}
// A real customisation module will define and export one or more of the