Skip to content

Commit

Permalink
feat: align media type with sd-jwt-vc draft 06 (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
charsleysa authored Nov 15, 2024
1 parent a1474fd commit 1aa3aea
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/sd-jwt-example/custom_header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { createSignerVerifier, digest, ES256, generateSalt } from './utils';
// Issue a signed JWT credential with the specified claims and disclosures
// Return a Encoded SD JWT. Issuer send the credential to the holder
const credential = await sdjwt.issue(claims, disclosureFrame, {
header: { typ: 'vc+sd-jwt', custom: 'data' }, // You can add custom header data to the SD JWT
header: { typ: 'dc+sd-jwt', custom: 'data' }, // You can add custom header data to the SD JWT
});
console.log('encodedSdjwt:', credential);

Expand Down
2 changes: 1 addition & 1 deletion examples/sd-jwt-vc-example/custom_header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import { createSignerVerifier, digest, ES256, generateSalt } from './utils';
},
disclosureFrame,
{
header: { typ: 'vc+sd-jwt', custom: 'data' }, // You can add custom header data to the SD JWT
header: { typ: 'dc+sd-jwt', custom: 'data' }, // You can add custom header data to the SD JWT
},
);
console.log('encodedSdjwt:', credential);
Expand Down
2 changes: 1 addition & 1 deletion packages/sd-jwt-vc/src/sd-jwt-vc-instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class SDJwtVcInstance extends SDJwtInstance<SdJwtVcPayload> {
/**
* The type of the SD-JWT-VC set in the header.typ field.
*/
protected type = 'vc+sd-jwt';
protected type = 'dc+sd-jwt';

protected userConfig: SDJWTVCConfig = {};

Expand Down
4 changes: 2 additions & 2 deletions packages/sd-jwt-vc/test/app-e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ async function JSONtest(filename: string) {

expect(validated).toBeDefined();
expect(validated).toStrictEqual({
header: { alg: 'EdDSA', typ: 'vc+sd-jwt' },
header: { alg: 'EdDSA', typ: 'dc+sd-jwt' },
payload,
});

Expand All @@ -259,7 +259,7 @@ async function JSONtest(filename: string) {

expect(verified).toBeDefined();
expect(verified).toStrictEqual({
header: { alg: 'EdDSA', typ: 'vc+sd-jwt' },
header: { alg: 'EdDSA', typ: 'dc+sd-jwt' },
kb: undefined,
payload,
});
Expand Down

0 comments on commit 1aa3aea

Please sign in to comment.