@oslojs/asn1
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

@oslojs/asn1

Documentation: https://asn1.oslojs.dev

[!CAUTION] This package is highly experimental!

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

Readme

Keywords

Package Sidebar

Install

npm i @oslojs/asn1

Weekly Downloads

24

Version

0.2.0

License

MIT

Unpacked Size

55.6 kB

Total Files

11

Last publish

Collaborators

  • pilcrowonpaper