@peculiar/asn1-schema
Decorators and helper APIs for declaring ASN.1 schemas in TypeScript.
Last updated 6 months ago by GitHub Actions .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @peculiar/asn1-schema 
SYNC missed versions from official npm registry.

@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);

Related Links

Current Tags

  • 3.0.0                                ...           latest (a month ago)

56 Versions

  • 3.0.0                                ...           a month ago
  • 2.11.1                                ...           a month ago
  • 2.11.0                                ...           2 months ago
  • 2.10.0                                ...           2 months ago
  • 2.9.5                                ...           2 months ago
  • 2.9.4                                ...           3 months ago
  • 2.9.3                                ...           3 months ago
  • 2.9.2                                ...           3 months ago
  • 2.9.0                                ...           3 months ago
  • 2.8.0                                ...           6 months ago
  • 2.7.0                                ...           7 months ago
  • 2.6.0                                ...           a year ago
  • 2.5.0                                ...           a year ago
  • 2.4.0                                ...           a year ago
  • 2.3.15                                ...           2 years ago
  • 2.3.13                                ...           2 years ago
  • 2.3.8                                ...           3 years ago
  • 2.3.6                                ...           4 years ago
  • 2.3.3                                ...           4 years ago
  • 2.3.0                                ...           4 years ago
  • 2.2.0                                ...           4 years ago
  • 2.1.9                                ...           4 years ago
  • 2.1.8                                ...           5 years ago
  • 2.1.7                                ...           5 years ago
  • 2.1.6                                ...           5 years ago
  • 2.1.5                                ...           5 years ago
  • 2.1.0                                ...           5 years ago
  • 2.0.44                                ...           5 years ago
  • 2.0.38                                ...           5 years ago
  • 2.0.37                                ...           5 years ago
  • 2.0.36                                ...           5 years ago
  • 2.0.32                                ...           6 years ago
  • 2.0.29                                ...           6 years ago
  • 2.0.27                                ...           6 years ago
  • 2.0.26                                ...           6 years ago
  • 2.0.25                                ...           6 years ago
  • 2.0.23                                ...           6 years ago
  • 2.0.17                                ...           6 years ago
  • 2.0.13                                ...           6 years ago
  • 2.0.12                                ...           6 years ago
  • 2.0.11                                ...           6 years ago
  • 2.0.8                                ...           6 years ago
  • 2.0.7                                ...           6 years ago
  • 2.0.7-alpha.1                                ...           6 years ago
  • 2.0.5                                ...           6 years ago
  • 2.0.4                                ...           6 years ago
  • 2.0.3                                ...           7 years ago
  • 2.0.1                                ...           7 years ago
  • 1.1.2                                ...           7 years ago
  • 1.1.1                                ...           7 years ago
  • 1.1.0                                ...           7 years ago
  • 1.0.5                                ...           7 years ago
  • 1.0.4                                ...           7 years ago
  • 1.0.3                                ...           8 years ago
  • 1.0.2                                ...           8 years ago
  • 1.0.1                                ...           8 years ago

© 2010 - cnpmjs.org x YWFE | Home | YWFE