-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started
This page covers the shortest path from installation to a ranked ASN.1 definition candidate list.
npm install @pkistudio/asn1defsifterThe package exports:
-
@pkistudio/asn1defsifter: public core API. -
@pkistudio/asn1defsifter/core: core API alias. -
@pkistudio/asn1defsifter/app: standalone viewer initializer. -
@pkistudio/asn1defsifter/styles.css: standalone viewer styles.
import { createPkiComponentCorpus, findAsn1Candidates, parseInputToTlvNodes } from '@pkistudio/asn1defsifter';
const corpus = createPkiComponentCorpus();
const [node] = await parseInputToTlvNodes('300d06092a864886f70d01010b0500', { format: 'hex' });
const candidates = findAsn1Candidates(node, { schemaCorpus: corpus, maxResults: 5 });
console.log(candidates[0]);The example DER fragment is an AlgorithmIdentifier-shaped SEQUENCE containing an RSA signature algorithm OID and NULL parameters. The resolver returns ranked candidates rather than a single forced answer.
Use createPkiCandidateReport() when the built-in PKI corpus is enough:
import { createPkiCandidateReport } from '@pkistudio/asn1defsifter';
const report = await createPkiCandidateReport('300d06092a864886f70d01010b0500', {
profiles: ['x509', 'pkcs8'],
minScore: 0.8,
includeSubtrees: true
});
console.log(report.roots[0].summary.bestCandidate);See Candidate Reports for report shape details.
npm run dev -- --port 5173 --strictPortThen open:
http://localhost:5173/
The hosted viewer is available at:
https://pkistudio.github.io/asn1defsifter/
Use the embedded PkiStudioJS viewer's Load menu to load DER, BER, PEM, HEX, or clipboard input. ASN.1 Definition Sifter watches the viewer document and refreshes candidates when the document changes.
Use the viewer's Corpora menu to add, edit, remove, save, load, or revert the ASN.1 definition corpora used for candidate matching. The built-in PkiComponents corpus is active by default, and custom corpus names appear in candidate results.
Candidate results include:
- ASN.1
typeNameand optionalmoduleName. -
scorefrom0to1. -
confidenceaslow,medium, orhigh. - Human-readable evidence.
- Diagnostics that explain weak or mismatched aspects.
- Ambiguity notes for structurally plausible alternatives.
- Matched paths connecting TLV paths to schema paths.
DER does not preserve field names, module names, comments, or schema-level intent. A high score means the bytes are structurally compatible with a definition; it does not prove global uniqueness.