Skip to content

Commit

Permalink
feat: Allow supplying signer/verifier
Browse files Browse the repository at this point in the history
  • Loading branch information
nklomp committed Jan 13, 2023
1 parent 625ea6f commit 00892e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class SphereonJsonWebSignature2020 extends SphereonLdSignature {
type: this.getSupportedVerificationType(),
controller: controller,
publicKeyJwk,
}, {signer})
}, {signer, verifier: false})

// verificationKey.signer = () => signer

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ const getSigner = async (k: any, options = { detached: true }) => {
};

const applyJwa = async (k: any, options?: any) => {
const verifier = options?.verifier ? options.verifier : await getVerifier(k, options);
const verifier = options?.verifier !== undefined ? options.verifier : await getVerifier(k, options);
k.verifier = () => verifier as any;
if (k.privateKey) {
if (k.privateKey || options?.signer !== undefined) {
const signer = options?.signer ? options.signer : await getSigner(k, options);
k.signer = () => signer as any;
}
Expand Down

0 comments on commit 00892e2

Please sign in to comment.