diff --git a/packages/vc-handler-ld-local/src/suites/JsonWebSignature2020.ts b/packages/vc-handler-ld-local/src/suites/JsonWebSignature2020.ts index 7faccdf20..a35a57290 100644 --- a/packages/vc-handler-ld-local/src/suites/JsonWebSignature2020.ts +++ b/packages/vc-handler-ld-local/src/suites/JsonWebSignature2020.ts @@ -72,9 +72,9 @@ export class SphereonJsonWebSignature2020 extends SphereonLdSignature { type: this.getSupportedVerificationType(), controller: controller, publicKeyJwk, - }) + }, {signer: () => signer}) - verificationKey.signer = () => signer + // verificationKey.signer = () => signer const suite = new JsonWebSignature({ key: verificationKey, diff --git a/packages/vc-handler-ld-local/src/suites/impl/JsonWebKeyWithRSASupport.ts b/packages/vc-handler-ld-local/src/suites/impl/JsonWebKeyWithRSASupport.ts index 0b7deb82a..6a548a0ba 100644 --- a/packages/vc-handler-ld-local/src/suites/impl/JsonWebKeyWithRSASupport.ts +++ b/packages/vc-handler-ld-local/src/suites/impl/JsonWebKeyWithRSASupport.ts @@ -127,10 +127,10 @@ const getSigner = async (k: any, options = { detached: true }) => { }; const applyJwa = async (k: any, options?: any) => { - const verifier = await getVerifier(k, options); + const verifier = options?.verifier ? options.verifier : await getVerifier(k, options); k.verifier = () => verifier as any; if (k.privateKey) { - const signer = await getSigner(k, options); + const signer = options?.signer ? options.signer : await getSigner(k, options); k.signer = () => signer as any; } return k; @@ -184,11 +184,11 @@ export class JsonWebKey { ) => { const KeyPair = getKeyPairForType(k); const kp = await KeyPair.from(k as any); - let { detached, header } = options; + let { detached, header, signer, verifier } = options; if (detached === undefined) { detached = true; } - return useJwa(kp, { detached, header }); + return useJwa(kp, { detached, header, signer, verifier }); }; public signer!: () => any;