Skip to content

Commit

Permalink
Add example demonstrating the usage of generateKey with AES algorithms
Browse files Browse the repository at this point in the history
  • Loading branch information
oleiade committed Mar 27, 2023
1 parent ddeda5c commit 34fa553
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions examples/generateKey/generateKey-aes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { crypto } from "k6/x/webcrypto";

export default async function () {
const key = await crypto.subtle.generateKey(
{
name: "AES-CBC",
length: 256
},
true,
[
"encrypt",
"decrypt",
]
);

console.log(JSON.stringify(key))
}

0 comments on commit 34fa553

Please sign in to comment.