Skip to content

Commit

Permalink
add algs
Browse files Browse the repository at this point in the history
  • Loading branch information
shihjay2 committed Jul 14, 2024
1 parent e8e5d07 commit bb8cbce
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/verifySig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,22 @@ async function verifySig(req: any) {
if (req.body.client.key.jwk.alg === 'RS256') {
algs.push('rsa-v1_5-sha256')
}
if (req.body.client.key.jwk.alg === 'HS256') {
algs.push('hmac-sha256')
}
if (req.body.client.key.jwk.alg === 'PS512') {
algs.push('rsa-pss-sha512')
}
if (req.body.client.key.jwk.alg === 'ES256') {
algs.push('ecdsa-p256-sha256-sha256')
}
if (req.body.client.key.jwk.alg === 'ES384') {
algs.push('ecdsa-p384-sha384')
}
keys.set(req.body.client.key.kid, {
id: req.body.client.key.kid,
algs,
verify: createVerifier(key_jose as Uint8Array, 'rsa-v1_5-sha256'),
verify: createVerifier(key_jose as Uint8Array, algs[0]),
});
const verified = await httpbis.verifyMessage({
async keyLookup() {
Expand Down

0 comments on commit bb8cbce

Please sign in to comment.