// Only unlocking should decrypt the vault; other sensitive actions should
// throw if the vault is still locked and encrypted
- const purpose: KeyUsage[] = action === 'unlock' ? ['decrypt'] : ['encrypt']
+ const keyUsages: KeyUsage[] = action === 'unlock' ? ['decrypt'] : ['encrypt']
return crypto.subtle
.importKey('raw', password, 'PBKDF2', false, ['deriveKey'])
length: 256
}
return crypto.subtle
- .deriveKey(derivationAlgorithm, derivationKey, derivedKeyType, false, purpose)
+ .deriveKey(derivationAlgorithm, derivationKey, derivedKeyType, false, keyUsages)
})
.catch(err => {
console.error(err)