Socket
Socket
Sign inDemoInstall

parse-asn1

Package Overview
Dependencies
19
Maintainers
5
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-asn1

utility library for parsing asn1 files for use with browserify-sign.


Version published
Maintainers
5
Weekly downloads
8,966,197
increased by2.03%
Install size
324 kB

Weekly downloads

Package description

What is parse-asn1?

The parse-asn1 npm package is used for parsing ASN.1 (Abstract Syntax Notation One) data. ASN.1 is a standard interface description language for defining data structures that can be serialized and deserialized in a cross-platform way. This package is particularly useful for dealing with cryptographic formats, as many cryptographic protocols use ASN.1 to define the structure of keys and certificates.

What are parse-asn1's main functionalities?

Parsing ASN.1 DER

This feature allows you to parse ASN.1 DER (Distinguished Encoding Rules) encoded data. The code sample reads a DER-encoded file (e.g., a certificate) from the filesystem and uses parse-asn1 to parse it into a JavaScript object.

const parseAsn1 = require('parse-asn1');
const fs = require('fs');

const der = fs.readFileSync('certificate.der');
const certificate = parseAsn1(der);
console.log(certificate);

Extracting Public Key

This feature is used to extract a public key from a DER-encoded file. The code sample demonstrates how to read the DER file and parse it to obtain the public key information.

const parseAsn1 = require('parse-asn1');
const fs = require('fs');

const der = fs.readFileSync('publicKey.der');
const publicKey = parseAsn1(der);
console.log(publicKey);

Parsing Private Key

This feature enables the parsing of a private key from a DER-encoded file. The code sample shows how to read the DER file and use parse-asn1 to parse the private key.

const parseAsn1 = require('parse-asn1');
const fs = require('fs');

const der = fs.readFileSync('privateKey.der');
const privateKey = parseAsn1(der);
console.log(privateKey);

Other packages similar to parse-asn1

Readme

Source

parse-asn1

TRAVIS NPM

js-standard-style

utility library for parsing asn1 files for use with browserify-sign.

FAQs

Last updated on 05 Mar 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc