identity: the SD-JWT form of an AERE hybrid identity is judged on its ML-DSA-65 half by default, the Ed25519 half only on explicit request, and every verdict says postQuantum (rule sdjwt.hybrid-half); pq-pki: the signature algorithm a certificate or a revocation list declares must be its issuer key's (ALG_KEY, CRL_ALG_KEY); agents: an equivocation proof requires the agent's ML-DSA-65 key; pq-gateway: the status names the path to the backend and hybrid-only refuses a plain-HTTP backend; conformance 241 rules, 631 vectors
This commit is contained in:
1 parent
3ff21f7758
commit
0c8f1de3fd
122 files changed
+1205
-262
No files matched your search
@@ -60,14 +60,15 @@ async function main() {
|
||||
// ---------------------------------------------------------------- partea NOASTRA
|
||||
function cheiNoi(alg) {
|
||||
if (alg === 'ES256') { const k = crypto.generateKeyPairSync('ec', { namedCurve: 'P-256' }); return { priv: k.privateKey, pub: k.publicKey, jwk: J.publicJwk(k.publicKey), alg }; }
|
||||
const k = I.generateKeys(); return { priv: k, pub: k.public, jwk: J.publicJwk(k, alg), alg };
|
||||
const k = I.generateKeys(); return { priv: k, pub: k.public, jwk: J.publicJwk(k, alg, { classicalHalf: true }), alg };
|
||||
}
|
||||
const CL = { given_name: 'Ana', family_name: 'Pop', birthdate: '1990-01-01', age_over_18: true, nationalities: ['RO', 'DE'], address: { locality: 'Cluj', country: 'RO' }, issuing_authority: 'Example Authority', issuing_country: 'RO' };
|
||||
// status: null = credential FARA status (un `undefined` ar lua valoarea implicita a parametrului)
|
||||
const noiEmite = ({ iss, hol, alg, status = { status_list: { idx: IDX, uri: URI } }, extra = {} }) => V.issueSdJwtVc({ issuer: iss.priv, holder: hol.pub, vct: VCT, claims: CL, disclosable: ['given_name', 'family_name', 'birthdate', 'age_over_18', 'address'], arrayDisclosable: ['nationalities'], iss: 'https://issuer.aere.example', iat: CEAS, nbf: CEAS, exp: CEAS + 365 * 86400, alg, holderAlg: hol.alg, decoys: 2, ...(status !== null ? { status } : {}), ...extra });
|
||||
const noiPrezinta = (sd, reveal, hol, extra = {}) => V.presentSdJwtVc({ sdJwt: sd, reveal, holder: hol.priv, holderAlg: hol.alg, audience: AUD, nonce: NONCE, iat: CEAS, ...extra });
|
||||
// 2026-10-19 (AIP-25 C1): jumatatea Ed25519 a cheilor AERE se cere explicit (classicalHalf); masuratoarea EdDSA din 18 oct o folosea implicit
|
||||
const noiEmite = ({ iss, hol, alg, status = { status_list: { idx: IDX, uri: URI } }, extra = {} }) => V.issueSdJwtVc({ classicalHalf: true, issuer: iss.priv, holder: hol.pub, vct: VCT, claims: CL, disclosable: ['given_name', 'family_name', 'birthdate', 'age_over_18', 'address'], arrayDisclosable: ['nationalities'], iss: 'https://issuer.aere.example', iat: CEAS, nbf: CEAS, exp: CEAS + 365 * 86400, alg, holderAlg: hol.alg, decoys: 2, ...(status !== null ? { status } : {}), ...extra });
|
||||
const noiPrezinta = (sd, reveal, hol, extra = {}) => V.presentSdJwtVc({ classicalHalf: true, sdJwt: sd, reveal, holder: hol.priv, holderAlg: hol.alg, audience: AUD, nonce: NONCE, iat: CEAS, ...extra });
|
||||
const noiVerifica = (sd, { issuerKey, alg, statusListJwt = null, optiuni = {} }) => V.verifySdJwtVc(sd, { issuerKey, issuerAlg: alg, audience: AUD, nonce: NONCE, now: LA, expectedVct: VCT, ...(statusListJwt != null ? { statusListJwt } : {}), ...optiuni });
|
||||
const listaNoi = (iss, statuses, bits = 1, extra = {}) => V.issueStatusListJwt({ issuer: iss.priv, alg: iss.alg, uri: URI, statuses, bits, iat: CEAS, exp: CEAS + 3600, ...extra });
|
||||
const listaNoi = (iss, statuses, bits = 1, extra = {}) => V.issueStatusListJwt({ classicalHalf: true, issuer: iss.priv, alg: iss.alg, uri: URI, statuses, bits, iat: CEAS, exp: CEAS + 3600, ...extra });
|
||||
const toateValide = new Array(N).fill(0);
|
||||
const revocat = toateValide.map((_, i) => (i === IDX ? 1 : 0));
|
||||
const suspendat = toateValide.map((_, i) => (i === IDX ? 2 : 0));
|
||||
@@ -170,7 +171,7 @@ async function main() {
|
||||
const citit = V.readStatusListJwt(lAmestec, { key: iss.jwk, alg: 'EdDSA', uri: URI, now: LA });
|
||||
const citite = citit.ok ? amestec.map((_, i) => citit.statusAt(i)) : null;
|
||||
rand({ sens: 'lor->noi', caz: 'IMPACHETARE: lista LOR pe 2 biti cu 12 stari amestecate, citite de noi index cu index', noi: { valid: citit.ok && egal(citite, amestec), reason: citit.ok ? 'citit ' + JSON.stringify(citite) : citit.reason }, lor: { valid: true }, asteptat: { noi: 'VALID', lor: 'VALID' }, nota: 'citit: ' + JSON.stringify(citite) + ' = scris: ' + JSON.stringify(amestec) });
|
||||
const lNoiAmestec = V.issueStatusListJwt({ issuer: cheiNoi('EdDSA').priv, uri: URI, statuses: amestec, bits: 2, iat: CEAS });
|
||||
const lNoiAmestec = V.issueStatusListJwt({ issuer: cheiNoi('EdDSA').priv, alg: 'EdDSA', classicalHalf: true, uri: URI, statuses: amestec, bits: 2, iat: CEAS });
|
||||
const lorCitit = amestec.map((_, i) => tsl.getListFromStatusListJWT(lNoiAmestec).getStatus(i));
|
||||
rand({ sens: 'noi->lor', caz: 'IMPACHETARE: lista NOASTRA pe 2 biti cu 12 stari amestecate, citite de ei index cu index', noi: { valid: true }, lor: { valid: egal(lorCitit, amestec), reason: 'citit ' + JSON.stringify(lorCitit) }, asteptat: { noi: 'VALID', lor: 'VALID' }, nota: 'citit: ' + JSON.stringify(lorCitit) + ' = scris: ' + JSON.stringify(amestec) });
|
||||
await neg('NEGATIV: lista LOR pentru ALT uri (sub != uri-ul din jeton)', { lista: await listaLor(iss, toateValide, 1, { uri: URI + '-alta' }), motivNoi: /sub .* is not the uri/, motivLor: /sub|uri|Status List/i });
|
||||
|
||||
@@ -76,10 +76,11 @@ async function main() {
|
||||
const CL = { given_name: 'Ana', family_name: 'Pop', age_over_18: true, nationalities: ['RO', 'DE'], address: { street_address: 'Str. Lunga 1', locality: 'Cluj', country: 'RO' } };
|
||||
function cheiNoi(alg) {
|
||||
if (alg === 'ES256') { const k = crypto.generateKeyPairSync('ec', { namedCurve: 'P-256' }); return { priv: k.privateKey, pub: k.publicKey, jwk: J.publicJwk(k.publicKey), alg }; }
|
||||
const k = I.generateKeys(); return { priv: k, pub: k.public, jwk: J.publicJwk(k, alg), alg };
|
||||
const k = I.generateKeys(); return { priv: k, pub: k.public, jwk: J.publicJwk(k, alg, { classicalHalf: true }), alg };
|
||||
}
|
||||
const noiEmite = ({ iss, hol, alg, extra = {} }) => J.issueSdJwt({ issuer: iss.priv, holder: hol.pub, claims: CL, disclosable: ['given_name', 'family_name', 'age_over_18'], arrayDisclosable: ['nationalities'], iss: 'https://issuer.aere.example', iat: CEAS, exp: CEAS + 365 * 86400, alg, holderAlg: hol.alg, decoys: 2, ...extra });
|
||||
const noiPrezinta = (sd, reveal, hol, extra = {}) => J.presentSdJwt({ sdJwt: sd, reveal, holder: hol.priv, holderAlg: hol.alg, audience: AUD, nonce: NONCE, iat: CEAS, ...extra });
|
||||
// 2026-10-19 (AIP-25 C1): jumatatea Ed25519 a cheilor AERE se cere explicit (classicalHalf); masuratoarea EdDSA din 18 oct o folosea implicit
|
||||
const noiEmite = ({ iss, hol, alg, extra = {} }) => J.issueSdJwt({ classicalHalf: true, issuer: iss.priv, holder: hol.pub, claims: CL, disclosable: ['given_name', 'family_name', 'age_over_18'], arrayDisclosable: ['nationalities'], iss: 'https://issuer.aere.example', iat: CEAS, exp: CEAS + 365 * 86400, alg, holderAlg: hol.alg, decoys: 2, ...extra });
|
||||
const noiPrezinta = (sd, reveal, hol, extra = {}) => J.presentSdJwt({ classicalHalf: true, sdJwt: sd, reveal, holder: hol.priv, holderAlg: hol.alg, audience: AUD, nonce: NONCE, iat: CEAS, ...extra });
|
||||
const jwtDin = (antet, corp, k) => { const cap = b64u(JSON.stringify(antet)) + '.' + b64u(JSON.stringify(corp)); const date = Buffer.from(cap, 'ascii'); return cap + '.' + b64u(antet.alg === 'ES256' ? crypto.sign('sha256', date, { key: k, dsaEncoding: 'ieee-p1363' }) : crypto.sign(null, date, k)); };
|
||||
const sha = (d) => crypto.createHash('sha256').update(d).digest('base64url');
|
||||
|
||||
|
||||
Reference in new issue
Block a user