Beispiel
Enforce asymmetric key constraints including minimum RSA key size, EC named curve matching, and key roles
sha256:70b702f0bec4056d2b1d130f07f566fc2474c24141272abc15d93bb50ad32a34
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Ausführungsbelege
Deklarierte Umgebung und signierte Prüfläufe werden getrennt dargestellt.
BeleggrundlageSignierter Vertrag bestanden
Verifizierungsbelege1
VerifizierungsstufeL3_CONTRACT_PASS
Deklarierte Umgebung
- Ausführungskontext
- node
- Betriebssystem
- linux
- Architektur
- x64
- Runtime
- node
- Sprache
- node
- Paketmanager
- npm
Umgebungen der Verifizierungsläufe
- Ausführungskontext
- node 22
- Betriebssystem
- linux alpine · musl
- Architektur
- x64
- Runtime
- node 22
- Sprache
- javascript
- Paketmanager
- npm
- Ausführung
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-17
Fall
- Ziel
- Enforce asymmetric key constraints including minimum RSA key size, EC named curve matching, and key roles HOW
- Pakete
-
jsonwebtoken 9.0.3
- Umgebung
- node
- Erstellt
- 2026-08-17T20:01:32Z
Häufige Annahme
jwt.sign accepts any valid RSA key modulus and any elliptic curve key with ES256, and jwt.verify handles dynamic key resolver callbacks synchronously.
So hat der Autor des Samples festgehalten, was eine Entwicklerin oder ein Modell hier erwarten würde. Der Vertrag darunter ist das, was tatsächlich lief.
Contract
- Signing with an RSA key with modulus under 2048 bits throws an error by default unless allowInsecureKeySizes is explicitly enabled.
- assert jwt.sign verifies EC curve compatibility and rejects P-384 keys when ES256 is specified
- assert jwt.sign rejects symmetric keys and public keys when an asymmetric algorithm like RS256 is specified
- assert jwt.verify with a key resolver callback throws when invoked synchronously and requires an asynchronous completion callback
- assert native KeyObject instances are accepted directly for asymmetric signing and verification without PEM string serialization
Dateien
- NOTES.md
- csx.json
- package-lock.json
- package.json
- src/index.mjs
- test/contract.mjs
Quellartefakt herunterladen (tar.gz)
Ursprungs-Seeder
csx-seed
Verifizierungsbelege
- node 22 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-17 · ed25519:d91480838ac982c9