2022-06-14 17:10:53 +02:00
|
|
|
import { KeySuffixOptions } from "@bitwarden/common/enums/keySuffixOptions";
|
|
|
|
import { CryptoService } from "@bitwarden/common/services/crypto.service";
|
2021-06-22 22:11:29 +02:00
|
|
|
|
|
|
|
export class BrowserCryptoService extends CryptoService {
|
|
|
|
protected async retrieveKeyFromStorage(keySuffix: KeySuffixOptions) {
|
|
|
|
if (keySuffix === "biometric") {
|
|
|
|
await this.platformUtilService.authenticateBiometric();
|
|
|
|
return (await this.getKey())?.keyB64;
|
|
|
|
}
|
|
|
|
|
|
|
|
return await super.retrieveKeyFromStorage(keySuffix);
|
2021-12-21 15:43:35 +01:00
|
|
|
}
|
2021-06-22 22:11:29 +02:00
|
|
|
}
|