Skip to content

Commit

Permalink
update webpack sanity test
Browse files Browse the repository at this point in the history
  • Loading branch information
OR13 committed Feb 4, 2024
1 parent 09ea361 commit 7b24081
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
10 changes: 8 additions & 2 deletions examples/webpack-example/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,21 @@ const test = async () => {
const k2 = await transmute.key.generate('ES256', 'application/jwk+json')
const encoder = new TextEncoder();
const decoder = new TextDecoder()
const signer = transmute.detached.signer({ secretKeyJwk: k2 })
const signer = transmute.detached.signer({ remote: transmute.crypto.signer({ secretKeyJwk: k2 }) })
const message = '💣 test ✨ mesage 🔥'
const payload = encoder.encode(message)
const coseSign1 = await signer.sign({
protectedHeader: new Map([[1, -7]]),
unprotectedHeader: new Map(),
payload
})
const verifier = transmute.detached.verifier({ publicKeyJwk: transmute.key.publicFromPrivate(k2) })
const verifier = transmute.detached.verifier({
resolver: {
resolve: () => {
return transmute.key.publicFromPrivate(k2)
}
}
})
const verified = await verifier.verify({ coseSign1, payload })
console.log(decoder.decode(verified));

Expand Down
12 changes: 8 additions & 4 deletions examples/webpack-example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7b24081

Please sign in to comment.