convert key from string
This commit is contained in:
parent
b0c095450a
commit
2a8775fa40
|
@ -1,4 +1,6 @@
|
||||||
import { KeySuffixOptions } from 'jslib-common/enums/keySuffixOptions';
|
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';
|
import { CryptoService } from 'jslib-common/services/crypto.service';
|
||||||
|
|
||||||
|
@ -6,7 +8,7 @@ export class BrowserCryptoService extends CryptoService {
|
||||||
protected async retrieveKeyFromStorage(keySuffix: KeySuffixOptions) {
|
protected async retrieveKeyFromStorage(keySuffix: KeySuffixOptions) {
|
||||||
if (keySuffix === 'biometric') {
|
if (keySuffix === 'biometric') {
|
||||||
await this.platformUtilService.authenticateBiometric();
|
await this.platformUtilService.authenticateBiometric();
|
||||||
return (await this.getKey())?.keyB64;
|
return new SymmetricCryptoKey(Utils.fromB64ToArray((await this.getKey())?.keyB64).buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
return await super.retrieveKeyFromStorage(keySuffix);
|
return await super.retrieveKeyFromStorage(keySuffix);
|
||||||
|
|
Loading…
Reference in New Issue