ASN.1 TypeScript Libraries
August 30, 2026 ยท View on GitHub
These libraries were generated entirely or in part by the ASN.1 Compilation Service offered by Wildboar Software. The ASN.1 compiler itself is closed-source and proprietary, but the ASN.1 parser is open source.
Note
These modules were recently converted to being ESM only. It is time to make the leap. I will not maintain the CommonJS versions any more. Due to both Jest not supporting ESM (yet), the tests are broken and will stay broken for as long as it takes. I hate the entire Javashit ecosystem.
Testing
The project uses Vitest for running tests. You can run tests for the X.500 package using:
# Run tests once
npm run test:x500
# Run tests in watch mode
npm run test:x500:watch
The tests are located in packages/x500/test/jest/ and use the .spec.mts extension.
Remove all unused imports
This is slow and will crash from running out of memory if you try this for the whole project at once. Just do this for a single project at a time:
npx tslint --config tslint-imports.json --fix --project ./libs/<project>/tsconfig.lib.json
Publish All Modules
cd into dist/packages, then run
for dir in $(ls -1);
do
cd $dir
npm publish
cd ..
done
Version Bump All Modules
cd into packages, then run
for dir in $(ls -1);
do
cd $dir
jq --arg v "$(jq -r '.version' package.json)" '.version = $v' jsr.json > jsr.tmp && mv jsr.tmp jsr.json
cd ..
done
To Do
- Publish NPM packages with Provenance
- Refactor
XSDinto a separate module - Documentation
- MMS
- SNMPv3 (No formal module.)
- F515 (No artifact for this...)
- CAP (I already have code out there for this.)
- CSTA
- Prettify
- Implement XER for CINF
- Implement XER for RINF
- Implement XER for CMAIL
- Refactor some of X.500 into smaller libraries
- This has already been done partially by introducing the PKI-Stub module
siocould be weaned from direct dependency on x500 if you just add SAT/DirectoryStringiso-9798-3-saslcould be weaned from x500 if you add SIGNATURE- Many could be weaned if the info object classes could be refactored into a library (scvp, crmf)
acbiocould be weaned if CertificateList were includedcadescould be weaned if PolicyInformation were included in PKI-Stub (ess too)
Usage
Some libraries expose few or no imports directly from the main file. Instead, users must import from alternative entrypoints instead.
// This might not work.
import { Certificate } from "@wildboar/x500";
// This will work.
import { Certificate } from "@wildboar/x500/AuthenticationFramework";
Notes
- CINF and RINF may be useful for the OID registry.
- Error in
attributeDescriptorinAttributeCertificateDefinitions:&idenclosed in unnecessary{}.