Skip to content

Commit 9bd13bb

Browse files
panvatargos
authored andcommitted
crypto: update Wrapping and unwrapping keys webcrypto example
PR-URL: #43452 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent d0c78d2 commit 9bd13bb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/api/webcrypto.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ async function generateAndWrapHmacKey(format = 'jwk', hash = 'SHA-512') {
226226

227227
const wrappedKey = await subtle.wrapKey(format, key, wrappingKey, 'AES-KW');
228228

229-
return wrappedKey;
229+
return { wrappedKey, wrappingKey };
230230
}
231231

232232
async function unwrapHmacKey(
@@ -238,7 +238,7 @@ async function unwrapHmacKey(
238238
const key = await subtle.unwrapKey(
239239
format,
240240
wrappedKey,
241-
unwrappingKey,
241+
wrappingKey,
242242
'AES-KW',
243243
{ name: 'HMAC', hash },
244244
true,

0 commit comments

Comments
 (0)