From 9eb47d1147d15f87bf9e6ac8861bede21a2511dc Mon Sep 17 00:00:00 2001 From: nklomp Date: Sat, 14 Jan 2023 07:31:06 +0100 Subject: [PATCH] fix: RSA fixes for suite --- .../src/suites/impl/JsonWebSignatureWithRSASupport.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/vc-handler-ld-local/src/suites/impl/JsonWebSignatureWithRSASupport.ts b/packages/vc-handler-ld-local/src/suites/impl/JsonWebSignatureWithRSASupport.ts index 3def8abd7..1ffa50c1c 100644 --- a/packages/vc-handler-ld-local/src/suites/impl/JsonWebSignatureWithRSASupport.ts +++ b/packages/vc-handler-ld-local/src/suites/impl/JsonWebSignatureWithRSASupport.ts @@ -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 })