🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@peculiar/asn1-schema

Package Overview
Dependencies
Maintainers
7
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@peculiar/asn1-schema

Decorators and helper APIs for declaring ASN.1 schemas in TypeScript.

latest
Source
npmnpm
Version
2.8.0
Version published
Weekly downloads
12M
-10.85%
Maintainers
7
Weekly downloads
 
Created
Source

@peculiar/asn1-schema

License npm version

NPM

Decorators and helper APIs for declaring ASN.1 schemas in TypeScript.

This is the core package used by the schema modules in this repository. It lets you describe DER structures with decorators and convert them with AsnConvert, AsnParser, and AsnSerializer.

Installation

npm install @peculiar/asn1-schema

Overview

Abstract Syntax Notation One (ASN.1) is widely used across X.509, PKCS, CMS, OCSP, and related standards. This package keeps those mappings declarative and type-friendly by attaching schema metadata directly to classes.

TypeScript Example

import {
  AsnConvert,
  AsnProp,
  AsnPropTypes,
  AsnType,
  AsnTypeTypes,
} from "@peculiar/asn1-schema";

@AsnType({ type: AsnTypeTypes.Sequence })
class BasicConstraints {
  @AsnProp({ type: AsnPropTypes.Boolean, defaultValue: false })
  public cA = false;
}

const basicConstraints = new BasicConstraints();
basicConstraints.cA = true;

const encoded = AsnConvert.serialize(basicConstraints);
const decoded = AsnConvert.parse(encoded, BasicConstraints);

console.log(decoded.cA);

Keywords

asn

FAQs

Package last updated on 11 Jun 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts