convert key from string

This commit is contained in:
Robyn MacCallum 2021-11-17 10:14:32 -05:00
parent b0c095450a
commit 2a8775fa40
1 changed files with 3 additions and 1 deletions

View File

@ -1,4 +1,6 @@
import { KeySuffixOptions } from 'jslib-common/enums/keySuffixOptions';
import { Utils } from 'jslib-common/misc/utils';
import { SymmetricCryptoKey } from 'jslib-common/models/domain/symmetricCryptoKey';
import { CryptoService } from 'jslib-common/services/crypto.service';
@ -6,7 +8,7 @@ export class BrowserCryptoService extends CryptoService {
protected async retrieveKeyFromStorage(keySuffix: KeySuffixOptions) {
if (keySuffix === 'biometric') {
await this.platformUtilService.authenticateBiometric();
return (await this.getKey())?.keyB64;
return new SymmetricCryptoKey(Utils.fromB64ToArray((await this.getKey())?.keyB64).buffer);
}
return await super.retrieveKeyFromStorage(keySuffix);