{"_id":"@panva/asn1.js","_rev":"1-945a99b7b68061fa93ee780c8cda67af","name":"@panva/asn1.js","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@panva/asn1.js","version":"1.0.0","description":"ASN.1 encoder and decoder for Node.js with no dependencies (fork of asn1.js using native BigInt)","keywords":["asn.1","bigint","der","pem"],"homepage":"https://github.com/panva/asn1.js","repository":{"type":"git","url":"git+https://github.com/panva/asn1.js.git"},"license":"MIT","author":{"name":"Fedor Indutny"},"main":"lib/asn1.js","scripts":{"lint":"standard","lint-fix":"standard --fix","test":"mocha test/**/*-test.js"},"devDependencies":{"mocha":"^7.0.1","standard":"^14.3.1"},"engines":{"node":">=10.13.0"},"contributors":[{"name":"Filip Skokan","email":"panva.ip@gmail.com"}],"gitHead":"45f8b14bdc797986b02684a60e9954b9bf5dfd14","bugs":{"url":"https://github.com/panva/asn1.js/issues"},"_id":"@panva/asn1.js@1.0.0","_nodeVersion":"12.13.0","_npmVersion":"6.13.7","dist":{"integrity":"sha512-UdkG3mLEqXgnlKsWanWcgb6dOjUzJ+XC5f+aWw30qrtjxeNUSfKX1cd5FBzOaXQumoe9nIqeZUvrRJS03HCCtw==","shasum":"dd55ae7b8129e02049f009408b97c61ccf9032f6","tarball":"https://registry.npmjs.org/@panva/asn1.js/-/asn1.js-1.0.0.tgz","fileCount":18,"unpackedSize":46838,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeS/ajCRA9TVsSAnZWagAA4F4P/3mL7+vWvcTiWjupLQtS\nSjzzPn1+B2x8YYLiNp/W/u1YPzhoxAbb9XRbegm9J5NvtZzncRHwb/02iwXa\noNpKotvy3KH54MMHjd+/0NslpiyKqNuxvjZQt26hVOwtU6xbT370q22C2Jrb\nk4ijPlIxgsK+2/CtAbSrADJj7848CoI57mJe0rse3yloYU+1adFzWfMEbfmn\npFSMMTdhcjy2mGLE/A0lWUNBb1upCr5KqoWPgRD0VMyNhl41QamYL6bXU0p+\numASNOPZ+JGQ+D0eiFp6zWFl//hKAC+CnqeKYeKPa3lG22XQsxU6FCQX16LN\nnWGM92hLEInD3Y0fI71nUaqTX0prSLaPkZfcHcI4t3CdObs2KtTIzq1YXSzA\nqbR44CEfucBefaPXy85uGKEwGdkf0heIdLnGaKnYf5W/eQWeFuz4ooebumKU\nD6x6CT/7DPN8zca63/fOtnjjma/ACMAQUzLLNng3zNSkqP5QPBnlISB8vs3s\nC/iQeBRHL/+DKegOFXw69i6FRqzC79FGrhMwcugjpfsXKtuDm8Hos6gMi8Xa\nUZRUkR8r+74eUdKyncnoGz2zPAAQaAo6jwzegSlJlMyGwXc2gpQaobCGDo0h\nyZWEqzT6OuTXv1NCkx88z0RCj0SyYhGDQjpgVVURCraVr8lRcX4J7OiT0Dpf\nCQN8\r\n=uNH9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCCj7r7hi5jPMYYFJlTvAQPdTbmRiiuy7F2HzcrbIGidQIgYZF+PuV0FDp0kpDXd4czaJCBJ6DWj+M+KHqG/7tAEao="}]},"maintainers":[{"name":"panva","email":"panva.ip@gmail.com"}],"_npmUser":{"name":"panva","email":"panva.ip@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/asn1.js_1.0.0_1582036643402_0.33768578813763317"},"_hasShrinkwrap":false}},"time":{"created":"2020-02-18T14:37:23.364Z","1.0.0":"2020-02-18T14:37:23.543Z","modified":"2022-04-06T13:06:51.642Z"},"maintainers":[{"name":"panva","email":"panva.ip@gmail.com"}],"description":"ASN.1 encoder and decoder for Node.js with no dependencies (fork of asn1.js using native BigInt)","homepage":"https://github.com/panva/asn1.js","keywords":["asn.1","bigint","der","pem"],"repository":{"type":"git","url":"git+https://github.com/panva/asn1.js.git"},"contributors":[{"name":"Filip Skokan","email":"panva.ip@gmail.com"}],"author":{"name":"Fedor Indutny"},"bugs":{"url":"https://github.com/panva/asn1.js/issues"},"license":"MIT","readme":"# ASN1.js\n\nASN.1 DER Encoder/Decoder and DSL for Node.js with no dependencies\n\n## Acknowledgement\n\nThis is a fork of [@indutny's](https://github.com/indutny) `asn.js` library with the following\nchanges made:\n\n- all `.int()` returns are native `BigInt` values\n- lint using [`standard`](https://github.com/standard/standard)\n\n## Example\n\nDefine model:\n\n```js\nconst asn = require('@panva/asn1.js')\n\nconst Human = asn.define('Human', function () {\n this.seq().obj(\n this.key('firstName').octstr(),\n this.key('lastName').octstr(),\n this.key('age').int(),\n this.key('gender').enum({ 0: 'male', 1: 'female' }),\n this.key('bio').seqof(Bio)\n )\n})\n\nconst Bio = asn.define('Bio', function () {\n this.seq().obj(\n this.key('time').gentime(),\n this.key('description').octstr()\n )\n})\n```\n\nEncode data:\n\n```js\nconst output = Human.encode({\n firstName: 'Thomas',\n lastName: 'Anderson',\n age: 28,\n gender: 'male',\n bio: [\n {\n time: new Date('31 March 1999').getTime(),\n description: 'freedom of mind'\n }\n ]\n}, 'der')\n```\n\nDecode data:\n\n```js\nconst human = Human.decode(output, 'der')\nconsole.log(human)\n/*\n{ firstName: ,\n lastName: ,\n age: 28n,\n gender: 'male',\n bio:\n [ { time: 922820400000,\n description: } ] }\n*/\n```\n\n### Partial decode\n\nIts possible to parse data without stopping on first error. In order to do it,\nyou should call:\n\n```js\nconst human = Human.decode(output, 'der', { partial: true })\nconsole.log(human)\n/*\n{ result: { ... },\n errors: [ ... ] }\n*/\n```\n","readmeFilename":"README.md"}