Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@complyify/asn1

Package Overview
Dependencies
Maintainers
3
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@complyify/asn1

Javascript library for parsing Abstract Syntax Notation One (ASN.1)

  • 0.3.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
Maintainers
3
Weekly downloads
 
Created
Source

@complyify/asn1

Javascript library for Abstract Syntax Notation One (ASN.1).

Provides a programmatic interface for building an ASN.1 object model along with JSON serialization / deserialization.

Installation

npm install @complyify/asn1

Usage

import { JSONDeserializer, JSONSerializer, Universal } from '@complyify/asn1';

// Create an ASN.1 object model programmatically
const { Bool, Integer, Null, PrintableString, Sequence } = Universal;
const sequence = new Sequence([
  new Integer(-Number.MAX_SAFE_INTEGER),
  new Integer(Number.MAX_SAFE_INTEGER),
  new Integer('424242424242424242424242424242424242'), // big integer
  new Null(),
  new Bool(true),
  new PrintableString('nice marmot'),
]);

// Serialize the object model to JSON
const serialize = new JSONSerializer();
const json = serialize(sequence);

// Deserialize back to an ASN.1 object model
const deserialize = new JSONDeserializer();
const asn1ObjectModel = deserialize(json);

Encoders

There are a multitude of encoding rules available for ASN.1. Known encoders are shown below.

FormatImplementationSerializationDeserializationComments
JSONIncluded w/ this libraryYesYesA library specific JSON format as no JSON encoding rules exist as part of the ASN.1 standards
DER@complyify/asn1-derYesPlannedDistinguished Encoding Rules (DER) are the standard ASN.1 encoding rules for public key cryptography (certificates, RSA keys, et al.)
PEM@complyify/asn1-derYesPlannedPrivacy Enhanced Mail (PEM) is a base64-encoded and specially formatted version of DER commonly used to distribute X.509 certificates

Debugging

This library uses the @complyify/debug library for debugging. To enable debug messages, simply set the DEBUG environment variable.

# enable all debugging messages in this library
DEBUG=complyify:asn1:* <your-exec-here>
# enable all debug messages except the bit twiddling messages
DEBUG=complyify:asn1:*,-complyify:asn1:*:binary <your-exec-here>

FAQs

Package last updated on 14 Apr 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc