Skip to content

Commit

Permalink
add nonce and aud check
Browse files Browse the repository at this point in the history
Signed-off-by: F-Node-Karlsruhe <[email protected]>
  • Loading branch information
F-Node-Karlsruhe committed Apr 23, 2024
1 parent 3908b7c commit 5695e62
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions api/src/services/verifier/sdjwt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ export async function verifySDJWT(
header.kid as string
);
const verify = await ES256.getVerifier(publicKey);
if (nonce && payload.nonce !== nonce) {
return false;
}
if (aud && payload.aud !== aud) {
return false;
}
return verify(data, signature);
};

Expand Down

0 comments on commit 5695e62

Please sign in to comment.