Skip to content

Commit

Permalink
fix: RSA fixes for suite
Browse files Browse the repository at this point in the history
  • Loading branch information
nklomp committed Jan 14, 2023
1 parent 834642a commit 9eb47d1
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,9 @@ export class JsonWebSignature {
}

async verifySignature({ verifyData, verificationMethod, proof }: any) {
if (verificationMethod.publicKeyJwk) {
const key = verificationMethod.publicKeyJwk as CryptoKey
return await crypto.subtle.verify(key.algorithm?.name ? key.algorithm.name : 'SHA-256', key, new Uint8Array(proof.jws), verifyData)
if (verificationMethod.publicKey) {
const key = verificationMethod.publicKey as CryptoKey
return await subtle.verify(key.algorithm?.name ? key.algorithm.name : 'SHA-256', key, new Uint8Array(proof.jws), verifyData)
}
const verifier = await verificationMethod.verifier()
return verifier.verify({ data: verifyData, signature: proof.jws })
Expand Down

0 comments on commit 9eb47d1

Please sign in to comment.