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:
1 parent
fab02f7952
commit
e1bb4e25d8
109 files changed
+9823
-175
No files matched your search
@@ -172,6 +172,26 @@ async function judeca(artifact, input, online) {
|
||||
else if (st.witness === 'UNMEASURED') ambele(online ? 'unmeasurable' : 'claim-not-checked', online ? String(det.witness.detail).slice(0, 200) : 'the bundle brings notarized heads; this run was offline, they were not read');
|
||||
else if (st.form === 'PASSED') ambele('unwitnessed', 'no witness: every time in this bundle is the statement of whoever holds the keys');
|
||||
if (claim) nemasurat(acc, 'anchoring', 'claim-not-checked', 'an envelope of the bundle claims a notarization; this run was offline, the claim was not checked');
|
||||
} else if (artifact === 'sdjwt-presentation' || artifact === 'sdjwt-vc-presentation') {
|
||||
// an SD-JWT (RFC 9901) or an SD-JWT VC presentation, judged by sdjwt.mjs / sdjwt-vc.mjs with what THIS verifier brings: the issuer
|
||||
// key it chose (a public JWK), its clock (required), its audience and nonce, the issuer and the type it expects and, for a VC, the
|
||||
// credential type it expects and the Status List Token it fetched. These verifiers stop at their first refusal and name its rule;
|
||||
// a VC refusal may name a rule of sdjwt (the profile verifies the SD-JWT first)
|
||||
const vc = artifact === 'sdjwt-vc-presentation';
|
||||
const M = await incarca(vc ? 'sdjwtvc' : 'sdjwt'); const RB = VERIFICATOARE.sdjwt.reguli, RV = VERIFICATOARE['sdjwt-vc'].reguli;
|
||||
if (typeof input.now !== 'string') throw new Error('an SD-JWT presentation is judged on the verifier\'s clock: input.now (an RFC 3339 time) is required');
|
||||
const o = { now: input.now }; for (const k of ['issuerKey', 'issuerAlg', 'audience', 'nonce', 'expectedIssuer', 'requireKeyBinding', 'requireExp', 'maxAgeS', 'expectedTyp', 'expectedVct', 'statusListJwt', 'statusListKey', 'statusListAlg', 'requireStatus']) if (input[k] !== undefined) o[k] = input[k];
|
||||
const r = vc ? M.verifySdJwtVc(input.sdJwt, o) : M.verifySdJwt(input.sdJwt, o);
|
||||
if (r.valid !== (r.rule == null)) throw new Error('the SD-JWT verifier refused without naming a rule');
|
||||
if (!r.valid) {
|
||||
const m = (vc && RV[r.rule]) || RB[r.rule]; if (!m) throw new Error('the SD-JWT verifier named a rule this suite does not map: ' + r.rule);
|
||||
pica(acc, m[1], m[0], r.reason); nemasurat(acc, m[1] === 'integrity' ? 'authenticity' : 'integrity', 'not-reached', 'the verifier stopped at its first refusal');
|
||||
} else {
|
||||
trece(acc, 'integrity', `no rule of the SD-JWT${vc ? ' VC' : ''} verifier refused: ${r.disclosed.length} disclosure(s) bound to the issuer-signed JWT${vc ? ', vct ' + r.vct : ''}`);
|
||||
trece(acc, 'authenticity', `the issuer-signed JWT verifies (${r.alg}) with the issuer key the verifier gave` + (r.keyBinding ? `; the key binding JWT (${r.keyBinding.alg}) verifies with cnf.jwk for this audience and nonce` : '; no key binding (the verifier did not require one)'));
|
||||
if (vc && r.status && r.status.present && !r.status.judged) nemasurat(acc, 'integrity', 'claim-not-checked', `the credential names a status (${r.status.mechanism}${r.status.uri ? ' at ' + r.status.uri : ''}) and no list was judged: the verifier waived it`);
|
||||
}
|
||||
for (const l of ['anchoring', 'finality']) nemasurat(acc, l, 'not-judged', 'an SD-JWT is anchored by notarizing an AIP-23 envelope of it, judged as the artifact `envelope`');
|
||||
} else if (artifact.startsWith('dataset-')) {
|
||||
const M = await incarca('baza'); let r;
|
||||
if (artifact === 'dataset-record') r = M.verificaInregistrare(input.record, input.commitment);
|
||||
|
||||
Reference in new issue
Block a user