Skip to content

Commit

Permalink
update to sd-jwt-vc which includes vct instead of type
Browse files Browse the repository at this point in the history
Signed-off-by: Berend Sliedrecht <[email protected]>
  • Loading branch information
berendsliedrecht committed Nov 18, 2023
1 parent 32d0977 commit 08ba90f
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 25 deletions.
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
# Selective Disclosure JWT (SD-JWT) Draft 06 & Selective Disclosure JWT VC
# Selective Disclosure JWT (SD-JWT) Draft 06 & Selective Disclosure JWT VC 01

## Compliant with

- [sd-jwt
06](https://datatracker.ietf.org/doc/draft-ietf-oauth-selective-disclosure-jwt/06/)
- [sd-jwt-vc
00](https://datatracker.ietf.org/doc/draft-ietf-oauth-sd-jwt-vc/00/)

> NOTE: the latest specifications are sd-jwt 06 & sd-jwt-vc 01. This library is
> not conformat, yet with sd-jwt-vc 01.
01](https://datatracker.ietf.org/doc/draft-ietf-oauth-sd-jwt-vc/01/)

## Design decisions

Expand Down
3 changes: 2 additions & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"simple": "ts-node simple.ts",
"no-disclosures": "ts-node noDisclosures.ts",
"triangle": "ts-node issuerHolderVerifier.ts",
"vc": "ts-node vc.ts"
"vc": "ts-node vc.ts",
"all": "pnpm simple; pnpm complex; pnpm no-disclosures; pnpm triangle; pnpm vc"
},
"keywords": [],
"author": "",
Expand Down
2 changes: 1 addition & 1 deletion example/vc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const issuer = async () => {
'https://w3id.org/security/bbs/v1'
],
id: 'https://issuer.oidp.uscis.gov/credentials/83627465',
type: ['VerifiableCredential', 'PermanentResidentCard'],
vct: ['VerifiableCredential', 'PermanentResidentCard'],
issuer: 'did:key:zUC74VEqqhEHQcgv4zagSPkqFJxuNWuoBPKjJuHETEUeHLoSqWt92viSsmaWjy82y2cgguc8e9hsGBifnVK67pQ4gve3m6iSboDkmJjxVEb1d6mRAx5fpMAejooNzNqqbTMVeUN',
identifier: '83627465',
name: 'Permanent Resident Card',
Expand Down
4 changes: 2 additions & 2 deletions src/sdJwtVc/sdJwtVc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class SdJwtVc<
> extends SdJwt<Header, Payload> {
public assertNonSelectivelyDisclosableClaims() {
if (!this.disclosureFrame) return
;['iss', 'type', 'iat', 'cnf'].forEach(
;['iss', 'vct', 'iat', 'cnf'].forEach(
this.assertNonSelectivelyDisclosableClaim
)
}
Expand All @@ -29,7 +29,7 @@ export class SdJwtVc<
this.assertClaimInHeader('alg')

this.assertClaimInPayload('iss')
this.assertClaimInPayload('type')
this.assertClaimInPayload('vct')
this.assertClaimInPayload('iat')
this.assertClaimInPayload('cnf', expectedCnfClaim)
} catch (e) {
Expand Down
Loading

0 comments on commit 08ba90f

Please sign in to comment.