ber-parser

1.0.5 • Public • Published

ber-parser

A simple ASN1 BER parser

purpose

This module implements parsing of data encoded according to ASN1 Basic Encoding Rules (BER) of ITU-T X.690 Recommendations.

usage

All the processing is done within one function: readTlv(buffer: Buffer, pos: number, parseValues?: boolean)

  • buffer - actual data to parse
  • pos - start position in the buffer
  • parseValue - indicates whether the individual type-dependant parsers should be applied to values (they are declared in a CLASS_TYPES object for some common types)

You can print out to console the contents of the resulting object with an additional function showTlv(tlv).

example

const {readTlv, showTlv} = require('ber-parser');
showTlv(readTlv(someBuffer, 0, true));

/ber-parser/

    Package Sidebar

    Install

    npm i ber-parser

    Weekly Downloads

    5

    Version

    1.0.5

    License

    MIT

    Unpacked Size

    9.98 kB

    Total Files

    6

    Last publish

    Collaborators

    • bitwkit