Skip to content

Commit

Permalink
refactor: use full json web key
Browse files Browse the repository at this point in the history
Signed-off-by: Nam Hoang <[email protected]>
  • Loading branch information
namhoang1604 committed Nov 23, 2023
1 parent 376d345 commit 755abe8
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/MerkleDisclosureProof2021.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ export class MerkleDisclosureProof2021 {
proof.rootNonce = merkleProof.rootNonce;

// produce compact jws
const k = await (this.key as any).useJwa({
detached: false,
header: {
// we don't need this here, but we will need it when multi message JWS is possible.
// kid: this.key.id,
},
});
const signer = k.signer();
// const k = await (this.key as any).useJwa({
// detached: true,
// header: {
// // we don't need this here, but we will need it when multi message JWS is possible.
// // kid: this.key.id,
// },
// });
const signer = this.key.signer();
const signature = await signer.sign({
data: Buffer.from(merkleProof.root, 'hex').toString('base64'),
});
Expand Down Expand Up @@ -250,13 +250,13 @@ export class MerkleDisclosureProof2021 {
return framed;
}

const key: any = await JsonWebKey.from(framed);
return key.useJwa({
detached: false,
header: {
// we don't need this here, but we will need it when multi message JWS is possible.
// kid: this.key.id,
},
});
return JsonWebKey.from(framed);
// return key.useJwa({
// detached: true,
// header: {
// // we don't need this here, but we will need it when multi message JWS is possible.
// // kid: this.key.id,
// },
// });
}
}

0 comments on commit 755abe8

Please sign in to comment.