{"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":"71d12cde59028d2d542dce8a081f12abb7ba78b0","tarball":"https://registry.npmjs.org/ts-nkeys/-/ts-nkeys-1.0.16-2.tgz","fileCount":26,"integrity":"sha512-hyCp8s80gKOvIO2VE7j1WgeRNa+SXABlYDG/bDtSkS6dV149fX0hb0lOFXix9HCEp6j0XGgqcZ/nhNHbp9f5kA==","signatures":[{"sig":"MEQCIDKQA08nY5LhyHcjQ0aELAsTJGpUy64WSw1I9E5rDdvoAiB7dtyfxWeTCRCnYSkU4eMsRlHcNGLWXJX7Rhi+SLovow==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60796,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeVSr0CRA9TVsSAnZWagAAs8kP/it/uExEXvGXC5UiiGip\nywbNEsQvvi0O6GUkM0GChmTm9sTXOtyEFhYyAecX9+erKX5lT9g9nAsuCYZ3\nKjHQ4oVrtASPff8bcUVrvIH7+cxYLSbpvd3epD7+T8d4Om+A3P186owHgtDR\ntinw4ev/Kz/RUwEwhxbTVeZzW8N+Q5i1HPzUuJmlOr7jKaoa/dV2wf14vv56\nVamWEVPh3HfTpj5H7faN3GU91pa4rKc7ZXEebE2PZwy+YL9u03AFbSejotqM\nGExgYqv0TSGxITmcmbzzn/Lqe293yv2Ct9chLQDCQpPVLVZ9Jbio9CglDEqi\nLzyI0JpMiAXw00PkTG5UJJo76HNQcqTTuIgdZ+cL7xQMfTIzbgEczzWltDFk\n+4/j5ja24jvny0B63TCyUJD/DARy3dAPXElswwIuA0FCJV6Vf/I+1h2PX53y\nrVa7adref/u7nOjRmtBCc3mae6tEp1vf6ePEQqfV8tltM8JIsLeDFyDDpFar\nhSchoshCcIuD/Vy7fWufGKDkcWKlN2WHMRbAfU9AVSNJn3CGP9QeJxdFuq09\neYdAQabqV6+5lkpC3upIe8/f0Eykz+AIl08+qtY8UiqSzwBT3f4K+lKrXtUd\nTDjku73FyOUPp3rtueQDgu2X86q3OYi0vQgPdXtSm9AvtWUbN4x9CZpZYVDB\n4VvY\r\n=d2u+\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":"97d260289897fe15d0227e43463a38a9193d550d","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-2_1582639859646_0.20436592557324507","host":"s3://npm-registry-packages"},"_id":"ts-nkeys@1.0.16-2","version":"1.0.16-2"}