Sha256: 1f964fb2873218cc81366ef235e99182f0ea8474228c1e4eedcc92cc71ce4d4b

Contents?: true

Size: 1.17 KB

Versions: 29

Compression:

Stored size: 1.17 KB

Contents

node-asn1 is a library for encoding and decoding ASN.1 datatypes in pure JS.
Currently BER encoding is supported; at some point I'll likely have to do DER.

## Usage

Mostly, if you're *actually* needing to read and write ASN.1, you probably don't
need this readme to explain what and why.  If you have no idea what ASN.1 is,
see this: ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc

The source is pretty much self-explanatory, and has read/write methods for the
common types out there.

### Decoding

The following reads an ASN.1 sequence with a boolean.

    var Ber = require('asn1').Ber;

    var reader = new Ber.Reader(Buffer.from([0x30, 0x03, 0x01, 0x01, 0xff]));

    reader.readSequence();
    console.log('Sequence len: ' + reader.length);
    if (reader.peek() === Ber.Boolean)
      console.log(reader.readBoolean());

### Encoding

The following generates the same payload as above.

    var Ber = require('asn1').Ber;

    var writer = new Ber.Writer();

    writer.startSequence();
    writer.writeBoolean(true);
    writer.endSequence();

    console.log(writer.buffer);

## Installation

    npm install asn1

## License

MIT.

## Bugs

See <https://github.com/joyent/node-asn1/issues>.

Version data entries

29 entries across 28 versions & 12 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/asn1/README.md
disco_app-0.18.0 test/dummy/node_modules/asn1/README.md
disco_app-0.18.2 test/dummy/node_modules/asn1/README.md
tang-0.2.1 spec/tang_app/node_modules/asn1/README.md
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/asn1/README.md
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/asn1/README.md
ruby2js-4.0.4 lib/tasks/testrails/node_modules/asn1/README.md
ruby2js-4.0.3 lib/tasks/testrails/node_modules/asn1/README.md
tang-0.2.0 spec/tang_app/node_modules/asn1/README.md
tang-0.1.0 spec/tang_app/node_modules/asn1/README.md
tang-0.0.9 spec/tang_app/node_modules/asn1/README.md
enju_library-0.3.8 spec/dummy/node_modules/asn1/README.md
ilog-0.4.1 node_modules/asn1/README.md
ilog-0.4.0 node_modules/asn1/README.md
ilog-0.3.3 node_modules/asn1/README.md
learn_create-0.0.22 lib/templates/javascript_lab_template/node_modules/asn1/README.md
jester-data-8.0.0 node_modules/asn1/README.md
ezii-os-5.2.1 node_modules/asn1/README.md
ezii-os-2.0.1 node_modules/asn1/README.md
ezii-os-1.1.0 node_modules/asn1/README.md