From 64e640806b51469bd0137d7a56929f2f33a697c7 Mon Sep 17 00:00:00 2001 From: Timo Glastra Date: Wed, 1 May 2024 15:22:34 +0200 Subject: [PATCH] chore: update to sd_hash Signed-off-by: Timo Glastra --- lib/PEX.ts | 4 ++-- lib/signing/types.ts | 2 +- test/SdJwt.spec.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/PEX.ts b/lib/PEX.ts index 7157b227..716fb08e 100644 --- a/lib/PEX.ts +++ b/lib/PEX.ts @@ -309,7 +309,7 @@ export class PEX { // aud MUST be set by the signer or provided by e.g. SIOP/OpenID4VP lib payload: { iat: new Date().getTime(), - _sd_hash: sdHash, + sd_hash: sdHash, }, } satisfies SdJwtKbJwtInput; @@ -495,7 +495,7 @@ export class PEX { payload: { iat: new Date().getTime(), nonce: proofOptions?.nonce, - _sd_hash: sdHash, + sd_hash: sdHash, }, } satisfies SdJwtKbJwtInput; diff --git a/lib/signing/types.ts b/lib/signing/types.ts index 426c5ac7..d2b2cabe 100644 --- a/lib/signing/types.ts +++ b/lib/signing/types.ts @@ -90,7 +90,7 @@ export interface SdJwtKbJwtInput { }; payload: { iat: number; - _sd_hash: string; + sd_hash: string; nonce?: string; }; } diff --git a/test/SdJwt.spec.ts b/test/SdJwt.spec.ts index 2b297b56..497aa423 100644 --- a/test/SdJwt.spec.ts +++ b/test/SdJwt.spec.ts @@ -223,7 +223,7 @@ describe('evaluate', () => { payload: { iat: expect.any(Number), nonce: undefined, - _sd_hash: calculateSdHash(decodedSdJwtVcWithDisclosuresRemoved.compactSdJwtVc, 'sha-256', hasher), + sd_hash: calculateSdHash(decodedSdJwtVcWithDisclosuresRemoved.compactSdJwtVc, 'sha-256', hasher), }, }, });