Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project (loosely) adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 2.0.0 - 2025-XX-XX
## 2.0.0 - 2025-05-28

### Added

- `extractEmbeddedTypeMetadata()` utility function to extract and decode Type Metadata documents embedded in the `vctm` unprotected header of SD-JWT VCs
- `fetchTypeMetadataFromUrl()` utility function to fetch and optionally verify Type Metadata from URLs specified in the `vct` claim, with integrity validation support

### Changed

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

This is an implementation of [SD-JWT VC (I-D version 01)](https://drafts.oauth.net/oauth-sd-jwt-vc/draft-ietf-oauth-sd-jwt-vc.html) in Typescript. It provides a higher-level interface on top of the [@meeco/sd-jwt](https://github.com/Meeco/sd-jwt) library to create the compliant SD-JWT VCs.

**Note on `typ` header (as of v2.0.0 / Unreleased):**
**Note on `typ` header (as of v2.0.0):**

- The `typ` header for issued SD-JWT VCs is `dc+sd-jwt`.
- The `Verifier` will accept both `vc+sd-jwt` and `dc+sd-jwt`.
Expand Down
32 changes: 32 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,35 @@ export const ReservedJWTClaimKeys: CreateSDJWTPayloadKeys[] = [
'nbf',
'exp',
];

/**
* Represents the structure of a Type Metadata document as defined in the SD-JWT VC specification (Section 6.2).
*/
export interface TypeMetadata {
vct?: string;
name?: string;
description?: string;
extends?: string; // URI
display?: Array<Record<string, any>>;
claims?: Array<Record<string, any>>;
/**
* OPTIONAL. An embedded JSON Schema document describing the structure of the Verifiable Credential.
* MUST NOT be used if schema_uri is present.
*/
schema?: Record<string, any>;
/**
* OPTIONAL. A URL pointing to a JSON Schema document.
* MUST NOT be used if schema is present.
*/
schema_uri?: string;

/**
* OPTIONAL. integrity metadata for vct, extends, schema_uri, and similar URIs.
* Value MUST be an "integrity metadata" string per W3C.SRI.
*/
'schema_uri#integrity'?: string;
'vct#integrity'?: string;
'extends#integrity'?: string;

[key: string]: any;
}
Loading