Skip to main content

Module vectors

Module vectors 

Source
Available on crate feature test-vectors only.
Expand description

The specification vectors the tests of this crate run against (feature test-vectors), so that a crate building on this one can test against the same examples: RFC 9901 (SD-JWT), SD-JWT VC, the Token Status List, VC-JOSE-COSE presentations, the DIF Well Known DID Configuration and DIF Linked Verifiable Presentation.

Every constant is the text of the specification’s example exactly as published, with a trailing newline; a compact token is one line, call trim before parsing it. The JOSE, DID and W3C VC examples the tests also use are short enough to live inline in the tests, and are not repeated here.

use identity_kit::sd_jwt_vc::SdJwt;
use identity_kit::vectors::sd_jwt::simple;

let issuance = SdJwt::parse(simple::ISSUANCE.trim())?;
assert_eq!(issuance.disclosures().len(), simple::DISCLOSURES.lines().count());

Modules§

did_configuration
DIF Well Known DID Configuration: the example resource and its credentials, and the example DID document with LinkedDomains services.
linked_vp
DIF Linked Verifiable Presentation v1.0.0: the example DID documents and presentations.
sd_jwt
RFC 9901 (SD-JWT), all signed with the issuer key of Appendix A.5.
sd_jwt_vc
SD-JWT VC: the credentials of §2.3 and Appendix A.1.
status_list
The Token Status List.
type_metadata
SD-JWT VC type metadata (SD-JWT VC §5 and Appendix A.2).
vc_jose_cose
VC-JOSE-COSE: VCDM 2.0 presentations secured with JOSE (vp+jwt) and credentials secured with SD-JWT (vc+sd-jwt).