Package Exports
- @oslojs/asn1
- @oslojs/asn1/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@oslojs/asn1) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@oslojs/asn1
Documentation: https://asn1.oslojs.dev
A JavaScript library for encoding and decoding ASN.1 with Distinguished Encoding Rules (DER) by Oslo.
- Runtime-agnostic
- No third-party dependencies
- Fully typed
import { parseASN1NoLeftoverBytes } from "@oslojs/asn1";
const parsed = parseASN1NoLeftoverBytes(encoded);
const oid = parsed.sequence().at(0).objectIdentifier();
if (!oid.is("1.2.840.10045.4.3.2")) {
throw new Error("Invalid OID");
}This library only supports DER and not CER or BER.
Installation
npm i @oslojs/asn1