identity: SD-JWT interoperability measured in both directions with @sd-jwt/core 0.23.0 and jose 6.2.12 (ML-DSA-65 included), nested _sd_alg refused, the SD-JWT VC profile (draft-19, dc+sd-jwt, vct, Token Status List offline); conformance: SD-JWT and SD-JWT VC enrolled (213 rules, 13 verifiers, 553 vectors)

This commit is contained in:
Aere Network committed 2026-10-18 11:07:27 +03:00
1 parent fab02f7952
commit e1bb4e25d8
109 files changed
+9823 -175

No files matched your search

+43 -1
View File
@@ -26,6 +26,10 @@ export const MODULE = {
ledger: { url: new URL('../agents/agent-ledger.mjs', import.meta.url), env: 'AERE_CONF_MODUL_LEDGER' },
identity: { url: new URL('../identity/identity.mjs', import.meta.url), env: 'AERE_CONF_MODUL_IDENTITY' },
device: { url: new URL('../device-identity/device.mjs', import.meta.url), env: 'AERE_CONF_MODUL_DEVICE' },
// 2026-10-18 (B10): SD-JWT (RFC 9901) and its SD-JWT VC profile. The profile imports sdjwt.mjs from its real file: a planted copy of
// sdjwt.mjs is reached only by the sdjwt-presentation artifact, so no sdjwt-vc vector expects a rule of sdjwt (it may exercise them)
sdjwt: { url: new URL('../identity/sdjwt.mjs', import.meta.url), env: 'AERE_CONF_MODUL_SDJWT' },
sdjwtvc: { url: new URL('../identity/sdjwt-vc.mjs', import.meta.url), env: 'AERE_CONF_MODUL_SDJWTVC' },
};
export const caleModul = (k) => process.env[MODULE[k].env] || fileURLToPath(MODULE[k].url);
export const incarca = (k) => import(pathToFileURL(caleModul(k)).href);
@@ -241,6 +245,45 @@ export const VERIFICATOARE = {
'witness-envelope': ['device.witness-envelope', I, 'the AIP-23 envelope given is the envelope of a device attestation, hashes to its statementHash and commits to this device and this attestation'],
'witness-time': ['device.witness-time', I, 'the attestation is not dated after the moment the verifier read its envelope on the chain (of several readings, the earliest)'],
unreadable: ['device.unreadable', I, 'every field a check reads can be read (a time is an RFC 3339 UTC time, a hash input is JSON)'] } },
// an SD-JWT presentation (IETF RFC 9901; enrolled 2026-10-18), judged with what the verifier brings: the issuer key it chose (a public
// JWK; never one taken from the token), its clock, its audience and nonce, the issuer and the type it expects. The verifier stops at its
// first refusal and names it; an integrity refusal leaves authenticity not reached, an authenticity refusal leaves integrity not reached
sdjwt: { artifacts: ['sdjwt-presentation'], sursa: 'sdjwt', reguli: {
form: ['sdjwt.form', I, 'the compact serialization (issuer-signed JWT ~ disclosures ~ key binding) and every JWS part can be read: three parts, canonical base64url, JSON objects, no empty disclosure; the verifier clock is a time'],
alg: ['sdjwt.alg', AU, 'the JWS algorithm is one the verifier accepts (ES256, EdDSA, ML-DSA-65); never none'],
typ: ['sdjwt.typ', I, 'the issuer-signed JWT carries the explicit type the verifier expects (any ...+sd-jwt by default; RFC 9901 Section 9.11) and the key binding JWT kb+jwt'],
crit: ['sdjwt.crit', I, 'no critical header parameter (crit) is present: none is understood'],
key: ['sdjwt.key', AU, 'the key given is a public EC, OKP or AKP JWK that can be read, and of the algorithm the JWS declares (no algorithm confusion)'],
signature: ['sdjwt.signature', AU, 'the JWS signature verifies with that key: the issuer-signed JWT with the issuer key the verifier chose, the key binding JWT with cnf.jwk'],
issuer: ['sdjwt.issuer', AU, 'iss is the issuer the verifier expects, when it names one'],
'sd-alg': ['sdjwt.sd-alg', I, '_sd_alg is sha-256 (or absent), and appears only at the top level of the payload (RFC 9901 Section 4.1.1)'],
'disclosure-form': ['sdjwt.disclosure-form', I, 'every disclosure is base64url JSON of [salt, name, value] for an object property or [salt, value] for an array element, and _sd is a list of strings'],
'disclosure-twice': ['sdjwt.disclosure-twice', I, 'no disclosure is given twice'],
'digest-twice': ['sdjwt.digest-twice', I, 'no digest appears more than once in the issuer-signed payload, directly or through disclosures (Section 7.1 step 4)'],
'disclosure-name': ['sdjwt.disclosure-name', I, 'no disclosure names _sd, ..., _sd_alg or __proto__, and no claim is named __proto__'],
'claim-conflict': ['sdjwt.claim-conflict', I, 'a disclosed claim does not already exist at its level (Section 7.1 step 3.c.ii.3)'],
unreferenced: ['sdjwt.unreferenced', I, 'every disclosure given is referenced by a digest of the issuer-signed JWT (Section 7.1 step 5)'],
time: ['sdjwt.time', I, 'exp, nbf and iat are numbers; exp is present when required and has not passed on the verifier clock (no allowance); nbf and iat are not ahead of it by more than the clock skew'],
'kb-context': ['sdjwt.kb-context', I, 'the verifier gave its audience and nonce when a key binding JWT is present or required (Section 7.3 step 5.f)'],
'kb-required': ['sdjwt.kb-required', I, 'a key binding JWT is present when the verifier requires one'],
'kb-cnf': ['sdjwt.kb-cnf', I, 'the issuer-signed JWT names the holder key (cnf.jwk) when a key binding JWT is given'],
'kb-claims': ['sdjwt.kb-claims', I, 'the key binding JWT carries aud, nonce, iat and sd_hash'],
'kb-audience': ['sdjwt.kb-audience', I, 'the key binding JWT was made for this verifier (aud)'],
'kb-nonce': ['sdjwt.kb-nonce', I, 'the key binding JWT carries the nonce this verifier gave'],
'kb-freshness': ['sdjwt.kb-freshness', I, 'the key binding JWT was made within the allowed age of the verifier clock, and its exp and nbf, if it carries them, hold'],
'kb-sd-hash': ['sdjwt.kb-sd-hash', I, 'sd_hash is the hash of exactly what was presented (the issuer-signed JWT and the disclosures shown)'] } },
// an SD-JWT VC presentation (draft-ietf-oauth-sd-jwt-vc, with the Token Status List; enrolled 2026-10-18): the rules of the profile on
// top of sdjwt; the verifier also brings the credential type it expects and the Status List Token it fetched
'sdjwt-vc': { artifacts: ['sdjwt-vc-presentation'], sursa: 'sdjwtvc', reguli: {
'vct-expected': ['sdjwtvc.vct-expected', I, 'the verifier names the credential type(s) it expects (expectedVct)'],
vct: ['sdjwtvc.vct', I, 'the payload carries vct, a non-empty string (draft-ietf-oauth-sd-jwt-vc Section 2.2.2.3)'],
'vct-mismatch': ['sdjwtvc.vct-mismatch', I, 'vct is one of the types the verifier expects'],
'disclosed-protected': ['sdjwtvc.disclosed-protected', I, 'none of iss, nbf, exp, cnf, vct, vct#integrity, aka_vcts, status was selectively disclosed (Section 2.2.2.3)'],
form: ['sdjwtvc.form', I, 'vct#integrity, if present, is a string; status is an object, and status.status_list carries a non-negative integer idx and a uri'],
'status-list': ['sdjwtvc.status-list', I, 'the Status List Token handed to the verifier can be read for the uri the credential names: signed with the key given, typ statuslist+jwt, sub equal to that uri, iat present and not ahead of the clock, exp not passed, status_list with bits 1, 2, 4 or 8 and an lst that inflates'],
'status-index': ['sdjwtvc.status-index', I, 'the index the credential names is inside the list'],
'status-revoked': ['sdjwtvc.status-revoked', I, 'the status at that index is 0 (VALID); 1 INVALID, 2 SUSPENDED and any other value refuse'],
'status-unjudged': ['sdjwtvc.status-unjudged', I, 'a status the credential names was judged, unless the verifier waived it (requireStatus false), in which case the verdict is PARTIAL'] } },
};
/**
* The FAILED sites of verify-proof's `finality` level, classified. `fragment` must appear on exactly one such source line; `re`
@@ -284,7 +327,6 @@ export const NEJUDECATE_DEVICE = { 'manufacture-missing': ['integrity', 'not-sup
'hardware-root': ['authenticity', 'unmeasurable'], 'witness-unread': ['anchoring', 'claim-not-checked'] };
/** Verifiers published beside these that the suite does NOT enrol yet, with the pattern that counts their refusal sites. */
export const NEINROLATE = [
{ name: 'identity: SD-JWT (RFC 9901)', files: [new URL('../identity/sdjwt.mjs', import.meta.url)], re: /\brefuz\(/g, why: 'its refusals carry texts, not rule ids (counted: the calls of its refusal helper); it is checked by its own probe, on the RFC 9901 vectors' },
{ name: 'identity: Travel Rule', files: [new URL('../identity/travel-rule.mjs', import.meta.url)], re: /motive\.push\(/g, why: 'its refusals are reasons in a list, not rule ids (counted: the places that add one); it takes the presentation verdict from the enrolled verifier' },
{ name: 'identity: compliance', files: [new URL('../identity/conformitate.mjs', import.meta.url)], re: /motive\.push\(/g, why: 'its refusals are reasons in a list, not rule ids (counted: the places that add one); it takes the presentation verdict from the enrolled verifier' },
];