Allow to choose if extractable or not
ci/woodpecker/push/test Pipeline was successful

This commit is contained in:
2024-06-11 14:32:23 +02:00
parent 1e5bf39b4f
commit 5cc375bd5a
6 changed files with 26 additions and 8 deletions
+2 -2
View File
@@ -12,14 +12,14 @@ export class SecretWrap {
private readonly iv: Uint8Array,
) {}
public static gen_key() : Promise<CryptoKey> {
public static gen_key(extractable : boolean = true) : Promise<CryptoKey> {
log.trace("generate key")
return crypto.subtle.generateKey(
{
name: "AES-GCM",
length: 256,
},
true,
extractable,
["wrapKey", "unwrapKey"],
)
}