Beispiel
@peculiar/asn1-schema 2.9.4
Verifiziertes Beispiel für npm @peculiar/asn1-schema 2.9.4. Der Vertrag lief auf node 22 · linux alpine/x64 · docker und bestand.
sha256:1ffa550956831143dd9bc1ad1293dcb1aae3c2ef524ce642ce13d2b2f822d6d3
Dieses Netzwerk bietet eine Sache: ein Sample, das baut. Es hat es in einer Sandbox ausgeführt und die signierte Quittung behalten. Es bewertet nichts und garantiert nichts — ob derselbe Code bei Ihnen baut, hat es nicht gemessen.
Wie viele verschiedene Signaturschlüssel eine bestandene Vertragsquittung eingereicht haben. Einer ist der Autor allein; mehr als einer heißt, jemand anderes hat es auch gebaut. Ein Schlüssel wird selbst erzeugt und hat keine registrierte Identität dahinter — gezählt werden Schlüssel, nicht Personen.
MIT-0
Ausführungsbelege
Die deklarierte Umgebung und die signierten Läufe stehen getrennt, damit Sie genau sehen, was dieses Sample ausgeführt hat und wo.
- Beleggrundlage
- Signierter Vertrag bestanden
- Verifizierungsbelege
- 1
- Signaturschlüssel, die es gebaut haben
- 1
Deklarierte Umgebung
linux 24 · ubuntu · glibc 2.39 x64 npm
Umgebungen der Verifizierungsläufe
| Umgebung | Contract | Stufen | Lauf |
|---|---|---|---|
| node 22 · linux alpine/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · node-typescript@1 |
2026-08-21 |
Fall
HOW- Ziel
- verify pkg:npm/%40peculiar/asn1-schema@2.9.4
- Pakete
- Erstellt
- 2026-08-21T07:17:22Z
Contract
- assert AsnSerializer.serialize and AsnParser.parse encode and decode typed class instances with primitive and nested ASN.1 schemas
- assert AsnConvert.serialize, AsnConvert.parse, and AsnConvert.toString provide high-level DER conversion and string visualization
- assert AsnChoiceType supports CHOICE schemas with contextual tags
- assert OctetString and BitString represent binary and bitstring ASN.1 values
- assert AsnParser.parse throws an error when parsing malformed ASN.1 buffers
Dateien
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- test/contract.mjs
Quelltext
Clean-room public code sample — generation instructions
Write a brand-new, minimal, self-contained code sample in this clean-room directory.
Do not copy, paraphrase, or reference any existing project source. Work only from this spec.
A csx.json manifest scaffold already exists. Do not recreate it from memory. Preserve its case.goal, packages and symbols; fill its empty case.contract with exact assertions and correct its environment, commands and verifierAdapter for the files you generate.
Goal: verify pkg:npm/%40peculiar/asn1-schema@2.9.4
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/%40peculiar/asn1-schema@2.9.4
Rules:
- One focused purpose; the smallest project that proves the goal.
- Include a contract test (test/contract.*) that runs OFFLINE and exits 0 exactly when the goal behavior works.
- Pin every dependency with a lockfile so resolution is reproducible.
- No secrets, credentials, or tokens. No real URLs (only example.com or localhost). No absolute paths.
- No personal names, emails, company names, or project identifiers of any kind.
- No binaries and no generated output (node_modules, dist, target, venv, .git, .env).
- Keep it under 200 files and 256KB packed.
{"case":{"caseId":"case:sha256:daba7510c3b1107fedd7e8b2204fd0bc69a079801615b85d192d24aa9b6de0d1","contract":["assert AsnSerializer.serialize and AsnParser.parse encode and decode typed class instances with primitive and nested ASN.1 schemas","assert AsnConvert.serialize, AsnConvert.parse, and AsnConvert.toString provide high-level DER conversion and string visualization","assert AsnChoiceType supports CHOICE schemas with contextual tags","assert OctetString and BitString represent binary and bitstring ASN.1 values","assert AsnParser.parse throws an error when parsing malformed ASN.1 buffers"],"goal":"verify pkg:npm/%40peculiar/asn1-schema@2.9.4","kind":"HOW","packages":["pkg:npm/%40peculiar/asn1-schema@2.9.4"],"schemaVersion":1,"symbols":["AsnChoiceType","AsnConvert.parse","AsnConvert.serialize","AsnConvert.toString","AsnParser.parse","AsnProp","AsnPropTypes","AsnSerializer.serialize","AsnType","AsnTypeTypes","BitString","OctetString"]},"contractCommand":["node","test/contract.mjs"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"npm","libc":"glibc","libcVersion":"2.39","os":"linux","osVersionBucket":"24","packageManager":"npm","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/%40peculiar/asn1-schema@2.9.4"],"schemaVersion":1,"subject":"pkg:npm/%40peculiar/asn1-schema@2.9.4","verifierAdapter":"node-typescript@1"}
{
"name": "sample-peculiar-asn1-schema",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-peculiar-asn1-schema",
"version": "1.0.0",
"dependencies": {
"@peculiar/asn1-schema": "2.9.4"
}
},
"node_modules/@peculiar/asn1-schema": {
"version": "2.9.4",
"resolved": "https://registry.npmjs.org/@peculiar/asn1-schema/-/asn1-schema-2.9.4.tgz",
"integrity": "sha512-GjzePcT9Iw8NzeOPf73iNS9xM+TBhd/FilAfP+RQGkTMQJTVWtytN3JHJACCjf/ABNau5S7mS3g+DcuxmRgYEg==",
"license": "MIT",
"dependencies": {
"@peculiar/utils": "^2.0.2",
"asn1js": "^3.0.10",
"tslib": "^2.8.1"
},
"engines": {
"node": ">=14"
}
},
"node_modules/@peculiar/utils": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/@peculiar/utils/-/utils-2.0.3.tgz",
"integrity": "sha512-+oL3HPFRIZ1St2K50lWCXiioIgSoxzz7R1J3uF6neO2yl1sgmpgY6XXJH4BdpoDkMWznQTeYF6oWNDZLCdQ4eQ==",
"license": "MIT",
"dependencies": {
"tslib": "^2.8.1"
}
},
"node_modules/asn1js": {
"version": "3.0.10",
"resolved": "https://registry.npmjs.org/asn1js/-/asn1js-3.0.10.tgz",
"integrity": "sha512-S2s3aOytiKdFRdulw2qPE51MzjzVOisppcVv7jVFR+Kw0kxwvFrDcYA0h7Ndqbmj0HkMIXYWaoj7fli8kgx1eg==",
"license": "BSD-3-Clause",
"dependencies": {
"pvtsutils": "^1.3.6",
"pvutils": "^1.1.5",
"tslib": "^2.8.1"
},
"engines": {
"node": ">=12.0.0"
}
},
"node_modules/pvtsutils": {
"version": "1.3.6",
"resolved": "https://registry.npmjs.org/pvtsutils/-/pvtsutils-1.3.6.tgz",
"integrity": "sha512-PLgQXQ6H2FWCaeRak8vvk1GW462lMxB5s3Jm673N82zI4vqtVUPuZdffdZbPDFRoU8kAhItWFtPCWiPpp4/EDg==",
"license": "MIT",
"dependencies": {
"tslib": "^2.8.1"
}
},
"node_modules/pvutils": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/pvutils/-/pvutils-1.2.0.tgz",
"integrity": "sha512-BbubeCEyTuQjVMakvJQ/Sxbc93F2pwmbsxONT/ZRrwU7Ua38d8unYTwXpTVLAKJ4BDuH9IGztCjQcd/N/39Dvg==",
"license": "MIT",
"engines": {
"node": ">=16.0.0"
}
},
"node_modules/tslib": {
"version": "2.8.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
"integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
"license": "0BSD"
}
}
}
{
"name": "sample-peculiar-asn1-schema",
"version": "1.0.0",
"type": "module",
"dependencies": {
"@peculiar/asn1-schema": "2.9.4"
}
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/%40peculiar/asn1-schema@2.9.4",
"kind": "HOW",
"packages": [
"pkg:npm/%40peculiar/asn1-schema@2.9.4"
]
}
import assert from "node:assert/strict";
import {
AsnProp,
AsnPropTypes,
AsnType,
AsnTypeTypes,
AsnChoiceType,
AsnParser,
AsnSerializer,
AsnConvert,
OctetString,
BitString,
} from "@peculiar/asn1-schema";
// 1. Nested Sequence Schema Definition
class NestedPayload {
constructor() {
this.label = "";
}
}
AsnType({ type: AsnTypeTypes.Sequence })(NestedPayload);
AsnProp({ type: AsnPropTypes.Utf8String })(NestedPayload.prototype, "label");
// Root Sequence Schema Definition
class ContainerRecord {
constructor() {
this.id = 0;
this.name = "";
this.active = false;
this.payload = new NestedPayload();
this.data = new OctetString();
this.optionalComment = undefined;
this.tags = [];
}
}
AsnType({ type: AsnTypeTypes.Sequence })(ContainerRecord);
AsnProp({ type: AsnPropTypes.Integer })(ContainerRecord.prototype, "id");
AsnProp({ type: AsnPropTypes.Utf8String })(ContainerRecord.prototype, "name");
AsnProp({ type: AsnPropTypes.Boolean })(ContainerRecord.prototype, "active");
AsnProp({ type: NestedPayload })(ContainerRecord.prototype, "payload");
AsnProp({ type: OctetString })(ContainerRecord.prototype, "data");
AsnProp({ type: AsnPropTypes.Utf8String, optional: true, context: 0, implicit: true })(ContainerRecord.prototype, "optionalComment");
AsnProp({ type: AsnPropTypes.Utf8String, repeated: "sequence", context: 1 })(ContainerRecord.prototype, "tags");
// Contract 1: AsnSerializer.serialize and AsnParser.parse encode and decode typed class instances with primitive and nested ASN.1 schemas
const record = new ContainerRecord();
record.id = 101;
record.name = "sample-record";
record.active = true;
record.payload.label = "nested-content";
record.data = new OctetString([0xde, 0xad, 0xbe, 0xef]);
record.optionalComment = "optional-info";
record.tags = ["tag-alpha", "tag-beta"];
const serializedDer = AsnSerializer.serialize(record);
assert.ok(serializedDer instanceof ArrayBuffer);
assert.ok(serializedDer.byteLength > 0);
const parsedRecord = AsnParser.parse(serializedDer, ContainerRecord);
assert.ok(parsedRecord instanceof ContainerRecord);
assert.equal(parsedRecord.id, 101);
assert.equal(parsedRecord.name, "sample-record");
assert.equal(parsedRecord.active, true);
assert.ok(parsedRecord.payload instanceof NestedPayload);
assert.equal(parsedRecord.payload.label, "nested-content");
assert.deepEqual(new Uint8Array(parsedRecord.data.buffer), new Uint8Array([0xde, 0xad, 0xbe, 0xef]));
assert.equal(parsedRecord.optionalComment, "optional-info");
assert.deepEqual(parsedRecord.tags, ["tag-alpha", "tag-beta"]);
// Contract 2: AsnConvert.serialize, AsnConvert.parse, and AsnConvert.toString provide high-level DER conversion and string visualization
const convertDer = AsnConvert.serialize(record);
assert.ok(convertDer instanceof ArrayBuffer);
const convertDecoded = AsnConvert.parse(convertDer, ContainerRecord);
assert.equal(convertDecoded.id, 101);
assert.equal(convertDecoded.name, "sample-record");
assert.equal(convertDecoded.active, true);
const derString = AsnConvert.toString(convertDer);
assert.ok(typeof derString === "string");
assert.ok(derString.length > 0);
// Contract 3: AsnChoiceType supports CHOICE schemas with contextual tags
class ChoicePayload {
constructor() {
this.textValue = undefined;
this.numericValue = undefined;
}
}
AsnChoiceType()(ChoicePayload);
AsnProp({ type: AsnPropTypes.Utf8String, context: 0 })(ChoicePayload.prototype, "textValue");
AsnProp({ type: AsnPropTypes.Integer, context: 1 })(ChoicePayload.prototype, "numericValue");
const choiceItem = new ChoicePayload();
choiceItem.textValue = "selected-text-branch";
const choiceDer = AsnConvert.serialize(choiceItem);
const decodedChoice = AsnConvert.parse(choiceDer, ChoicePayload);
assert.equal(decodedChoice.textValue, "selected-text-branch");
assert.equal(decodedChoice.numericValue, undefined);
// Contract 4: OctetString and BitString represent binary and bitstring ASN.1 values
class BinaryContainer {
constructor() {
this.octets = new OctetString();
this.bits = new BitString();
}
}
AsnType({ type: AsnTypeTypes.Sequence })(BinaryContainer);
AsnProp({ type: OctetString })(BinaryContainer.prototype, "octets");
AsnProp({ type: BitString })(BinaryContainer.prototype, "bits");
const binaryObj = new BinaryContainer();
binaryObj.octets = new OctetString(new Uint8Array([0x01, 0x02, 0x03, 0x04]));
binaryObj.bits = new BitString(new Uint8Array([0b11000000]).buffer, 2);
const binaryDer = AsnConvert.serialize(binaryObj);
const decodedBinary = AsnConvert.parse(binaryDer, BinaryContainer);
assert.deepEqual(new Uint8Array(decodedBinary.octets.buffer), new Uint8Array([0x01, 0x02, 0x03, 0x04]));
assert.equal(decodedBinary.bits.unusedBits, 2);
// Contract 5: AsnParser.parse throws an error when parsing malformed ASN.1 buffers
assert.throws(() => {
AsnParser.parse(new Uint8Array([0xff, 0xff, 0xff]), ContainerRecord);
});
console.log("Contract verified: all assertions passed.");
Ursprungs-Seeder
anonym