{"ava":{"files":["./lib/test/**/*.js","!./lib/test/helpers/**/*.js"],"require":["./lib/test/helpers/ava_fix.js"],"sources":["**/*.js"],"failFast":false},"nyc":{"all":false,"exclude":["lib/test/**","examples/**","benchmark/**"],"include":["src/**/*.ts","lib/src/**/*.js"],"extension":[".ts",".js"],"sourceMap":true},"dist":{"shasum":"9217248030d6ca84d5c9d3ad3ad68b50c0328d86","tarball":"https://registry.npmjs.org/ts-nkeys/-/ts-nkeys-1.0.16-1.tgz","fileCount":20,"integrity":"sha512-Baqu5ujl4i2OsoDE+IqP4p17LSQmzkMEYh+PF/oxZSo42i05+cJkAlSQcMINroMCc4tmS+kR9DTU/p9df5eWVg==","signatures":[{"sig":"MEYCIQDcf4dvFqkhBX5z6vQjWTA+rRG5NziZm14+dcsbaAxsFQIhAP9COYybnfTLdO2klEYDB8Z5U1B6gGh+qyGKWKsl16UN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":231801,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeVSqvCRA9TVsSAnZWagAAU1QP/0ItcyTiLXKxQV6FtEiP\no9vIUXf57SawyTXpY0V1x99AoLHPAMotmXPPpmmB53J8gxBPtAds6rMHjXaY\nKsE/SutYyRGGCOj/p6A9hlbp3k1nSp57N/kNqNxf1LXXVKMc7r8Fcx7+zIiK\nsHcF3dLsg8SFcKpAgA+5NwJI5mR50y30J/ptevJakZEo3Utv91hOOcw7kdh5\nPNr0V0+lAnHXKoeLVL9iUDbojQTaDbikoFdP3yteEu2Qqpm2dxOoNLjlO8d/\nn2rIHiX+ce6C7HVqSUq+0fshZlgrpEUO3arzT70VEgF2pkPKfM2gRz/lrmf+\n/HhvUUrDp0Dzq4wDTlE4uQXVnnojT1b18xh9yZtCnzlgXtUsX9En5t+qoRmq\nua9OFugCv1gEnaJ2jv2M/+v/6se2odayYNgM6/HzVU54w3EMO6C/0Fq8aVJc\np+6iIS+ZMC1JLhjJg0MQT6TZYzJ0wPXM7AifOgHpOParcRzups0GjcN+o/7/\nIPoY74qf1w76rcbOCGvSxIrMK0gWgHOd7EXPB0tzZe/N0GWCH+m6QkLmHn1O\nUryZvG97GGW5N/v81+JeAT6Ep+h1vCaPeyhuY+zMvE+05l9rdrhTzNlwBPdJ\nTUsDk9afcwpyXpI57ZIDKdM8K398kcTeVGMY80RlHTDqMvjmgDOT8RdlhPxZ\nEKWC\r\n=lhm9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/nkeys.js","name":"ts-nkeys","types":"lib/nkeys.d.ts","author":{"name":"The NATS Authors"},"readme":"# ts-nkeys\n\n\nA public-key signature system based on Ed25519 for the [NATS ecosystem system](https://nats.io) in JavaScript and Typescript.\n\n[![license](https://img.shields.io/github/license/nats-io/ts-nats.svg)](https://www.apache.org/licenses/LICENSE-2.0)\n[![Build Status](https://travis-ci.org/nats-io/ts-nkeys.svg?branch=master)](https://travis-ci.org/nats-io/ts-nkeys)\n[![Coveralls github branch](https://img.shields.io/coveralls/github/nats-io/ts-nkeys/master.svg)](https://coveralls.io/github/nats-io/ts-nkeys)\n[![npm](https://img.shields.io/npm/v/ts-nkeys.svg)](https://www.npmjs.com/package/ts-nkeys)\n[![npm](https://img.shields.io/npm/dt/ts-nkeys.svg)](https://www.npmjs.com/package/ts-nkeys)\n\nts-nkeys is a typescript nats library for node that for generating nkeys.\n\n## Installation\n\n```bash\nnpm install ts-nkeys\n```\n\n## Basic Usage\n\n```typescript\n    // create an user nkey - also possible to create accounts, clusters, servers.\n    let user = createUser();\n\n    // once you have an nkey you can generate various keys.\n    // A seed is the public and private keys together.\n    // Seeds are strings, and start with the letter 'S'. \n    // Seeds need to be kept safe and never shared.\n    let seed = user.getSeed();\n    t.true(Buffer.isBuffer(seed));\n    t.is(seed[0], 'S'.charCodeAt(0));\n    \n    // the second letter in the seed represents its type:\n    // `U` for user, \n    // `A` for account, \n    // `C` for cluster\n    // `N` for severs\n    t.is(seed[1], 'U'.charCodeAt(0));\n\n    // public keys can be shared and can be used to verify signed content\n    let publicKey = user.getPublicKey();\n    t.true(Buffer.isBuffer(publicKey));\n    // first letter represents the type of public key\n    // `U` for user, \n    // `A` for account, \n    // `C` for cluster\n    // `N` for severs\n    t.is(publicKey[0], 'U'.charCodeAt(0));\n\n\n    // To sign data\n    let data = Buffer.from(\"HelloWorld\");\n    let sig = user.sign(data);\n    \n    // to verify use the user, public or seed:\n    t.true(user.verify(data, sig));\n\n    // public keys can be used to verify signatures you cannot sign with them though.\n    let pk = fromPublic(publicKey);\n    t.true(pk.verify(data, sig));\n\n    // seeds can be used to reconstitute the keypair from a string\n    let sk = fromSeed(seed);\n    t.true(sk.verify(data, sig));\n    // and can be used to sign\n    let sig2 = sk.sign(data);\n    t.true(sk.verify(data, sig));\n```\n\n\n## Supported Node Versions\n\nOur support policy for Nodejs versions follows [Nodejs release support]( https://github.com/nodejs/Release).\nWe will support and build node-nats on even-numbered Nodejs versions that are current or in LTS.\n\n## License\n\nUnless otherwise noted, the NATS source files are distributed under the Apache Version 2.0 license found in the LICENSE file.\n","gitHead":"ef302353beb8d6c570868172f4eb9e862b4971c2","license":"Apache-2.0","scripts":{"pack":"npm run build && npm pack","test":"tsc && nyc ava --verbose -T 15000","build":"npm run clean:dist && tsc && npm run copy:dist","clean":"npm run clean:dist","copy:dist":"cp lib/src/* lib/","debugtest":"tsc && node node_modules/.bin/ava --verbose -T 6500000 --match","clean:dist":"rm -rf lib/* coverage/* .nyc_output/*","cover:html":"nyc report --reporter=html && open coverage/index.html","cover:coveralls":"nyc report --reporter=lcovonly && cat ./coverage/lcov.info | coveralls"},"_npmUser":{"name":"aricart","email":"alberto@synadia.com"},"keywords":["nats","Ed25519","node","typescript"],"repository":{"url":"https://github.com//nats-io/ts-nkeys","type":"git"},"_npmVersion":"6.13.7","description":"A public-key signature system based on Ed25519 for the NATS ecosystem in typescript for ts-nats and node-nats","directories":{},"maintainers":[{"name":"aricart","email":"alberto@synadia.com"}],"_nodeVersion":"12.15.0","dependencies":{"tweetnacl":"^1.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^2.4.0","nyc":"^15.0.0","ts-node":"^8.6.2","coveralls":"^3.0.9","typescript":"^3.8.2","@types/node":"^13.7.4","dependency-check":"^4.1.0"},"_npmOperationalInternal":{"tmp":"tmp/ts-nkeys_1.0.16-1_1582639791179_0.7986919068197866","host":"s3://npm-registry-packages"},"_id":"ts-nkeys@1.0.16-1","version":"1.0.16-1"}