Skip to content

Commit

Permalink
crypto: update Wrapping and unwrapping keys webcrypto example
Browse files Browse the repository at this point in the history
PR-URL: #43452
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
panva authored and targos committed Jul 31, 2022
1 parent 23ec1a8 commit 224d3f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/api/webcrypto.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ async function generateAndWrapHmacKey(format = 'jwk', hash = 'SHA-512') {

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

return wrappedKey;
return { wrappedKey, wrappingKey };
}

async function unwrapHmacKey(
Expand All @@ -238,7 +238,7 @@ async function unwrapHmacKey(
const key = await subtle.unwrapKey(
format,
wrappedKey,
unwrappingKey,
wrappingKey,
'AES-KW',
{ name: 'HMAC', hash },
true,
Expand Down

0 comments on commit 224d3f4

Please sign in to comment.