{"_id":"@conform_reward129/nkeys.js","_rev":"2-31cfd923f9744d0b06661cf8bc52786b","name":"@conform_reward129/nkeys.js","dist-tags":{"latest":"1.0.6-rc3"},"versions":{"1.0.6-rc1":{"name":"@conform_reward129/nkeys.js","version":"1.0.6-rc1","description":"A public-key signature system based on Ed25519 for the NATS ecosystem in javascript","main":"lib/index.js","types":"lib/index.d.ts","scripts":{"init":"mkdir -p build","clean":"rm -Rf build/ lib/ nkeys.d.ts nkeys.mjs","fmt":"deno fmt src/ examples/ modules/ test/ node_test/","cjs":"deno run --allow-all bin/cjs-fix-imports.ts -o build/ src/ modules/cjs/ node_test/","generate":"deno run -A --unstable ./bin/tweetnacl-esm.ts","stage":"npm run init && npm run cjs && npm run generate && tsc","prepare":"npm run stage && npm run generate && deno bundle modules/esm/mod.ts nkeys.mjs && tsc","test":"npm run prepare && ava --verbose && deno test -A --unstable test/","doc":"npm run clean && rm -Rf docs && npm run stage && node_modules/.bin/typedoc --out docs/ && touch ./docs/.nojekyll"},"engines":{"node":">=10.0.0"},"repository":{"type":"git","url":"https://github.com//nats-io/nkeys.js"},"keywords":["nats","Ed25519","javascript"],"author":{"name":"The NATS Authors"},"license":"Apache-2.0","dependencies":{"tweetnacl":"1.0.3"},"devDependencies":{"@types/node":"^18.11.x","ava":"^5.1.x","typedoc":"^0.23.x","typescript":"^4.9.x"},"ava":{"failFast":true,"require":[],"files":["./node_test/*.js"]},"gitHead":"9b08b6f038480607e0cbaac2d6a71b8beff58f35","_id":"@conform_reward129/nkeys.js@1.0.6-rc1","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-mJR1SKN60mxTJDsgguXLbb8NQb2MRkVBLZRxnuRON2yZPJ/SmqKG38kZlB7iQEy1TRY4k+iNmIFdZTg/6kJoPQ==","shasum":"555039f43b99911bcb8ee44f0691a2ef1d9e40ec","tarball":"https://registry.npmjs.org/@conform_reward129/nkeys.js/-/nkeys.js-1.0.6-rc1.tgz","fileCount":27,"unpackedSize":109714,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHLePE9RJDaNTUJ2hJFRDvDe5rJuY8JvAiOuc1cZGRPuAiAWobv7KK4K51DKPa6V5K5bkAT8dL78rGzaYuLk2Oa3ug=="}]},"_npmUser":{"name":"conform_reward129","email":"conform_reward129@mp.miknowak.pl"},"directories":{},"maintainers":[{"name":"conform_reward129","email":"conform_reward129@mp.miknowak.pl"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nkeys.js_1.0.6-rc1_1684087871948_0.3575233204962587"},"_hasShrinkwrap":false},"1.0.6-rc2":{"name":"@conform_reward129/nkeys.js","version":"1.0.6-rc2","description":"A public-key signature system based on Ed25519 for the NATS ecosystem in javascript","main":"lib/index.js","types":"lib/index.d.ts","scripts":{"init":"mkdir -p build","clean":"rm -Rf build/ lib/ nkeys.d.ts nkeys.mjs","fmt":"deno fmt src/ examples/ modules/ test/ node_test/","cjs":"deno run --allow-all bin/cjs-fix-imports.ts -o build/ src/ modules/cjs/ node_test/","generate":"deno run -A --unstable ./bin/tweetnacl-esm.ts","stage":"npm run init && npm run cjs && npm run generate && tsc","prepare":"npm run stage && npm run generate && deno bundle modules/esm/mod.ts nkeys.mjs && tsc","test":"npm run prepare && ava --verbose && deno test -A --unstable test/","doc":"npm run clean && rm -Rf docs && npm run stage && node_modules/.bin/typedoc --out docs/ && touch ./docs/.nojekyll"},"engines":{"node":">=10.0.0"},"repository":{"type":"git","url":"https://github.com//nats-io/nkeys.js"},"keywords":["nats","Ed25519","javascript"],"author":{"name":"The NATS Authors"},"license":"Apache-2.0","dependencies":{"tweetnacl":"1.0.3"},"devDependencies":{"@types/node":"^18.11.x","ava":"^5.1.x","typedoc":"^0.23.x","typescript":"^4.9.x"},"ava":{"failFast":true,"require":[],"files":["./node_test/*.js"]},"gitHead":"9b08b6f038480607e0cbaac2d6a71b8beff58f35","_id":"@conform_reward129/nkeys.js@1.0.6-rc2","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-rPN8HZq54vlSmy04hOCHxF3NohICtbsqmbs9f9zbysV/a2oqgJPaIaw4WyeAdRHFDzZRm7QUOBuo0VVgYEULeg==","shasum":"2dc7afa84c171e91df85ed304e9fa1a2e9f987dc","tarball":"https://registry.npmjs.org/@conform_reward129/nkeys.js/-/nkeys.js-1.0.6-rc2.tgz","fileCount":27,"unpackedSize":109464,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBk00CV9KQiDLgU5NFdg0WtpVE5lk0SsQGK/xLZHKlsTAiARpPz6dM5Gru56/RYV1EGKUNN5+Vpr8S/AlSPOViVqeQ=="}]},"_npmUser":{"name":"conform_reward129","email":"conform_reward129@mp.miknowak.pl"},"directories":{},"maintainers":[{"name":"conform_reward129","email":"conform_reward129@mp.miknowak.pl"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nkeys.js_1.0.6-rc2_1684088104992_0.8931280201082685"},"_hasShrinkwrap":false},"1.0.6-rc3":{"name":"@conform_reward129/nkeys.js","version":"1.0.6-rc3","description":"A public-key signature system based on Ed25519 for the NATS ecosystem in javascript","main":"lib/index.js","types":"lib/index.d.ts","scripts":{"init":"mkdir -p build","clean":"rm -Rf build/ lib/ nkeys.d.ts nkeys.mjs","fmt":"deno fmt src/ examples/ modules/ test/ node_test/","cjs":"deno run --allow-all bin/cjs-fix-imports.ts -o build/ src/ modules/cjs/ node_test/","generate":"deno run -A --unstable ./bin/tweetnacl-esm.ts","stage":"npm run init && npm run cjs && npm run generate && tsc","prepare":"npm run stage && npm run generate && deno bundle modules/esm/mod.ts nkeys.mjs && tsc","test":"npm run prepare && ava --verbose && deno test -A --unstable test/","doc":"npm run clean && rm -Rf docs && npm run stage && node_modules/.bin/typedoc --out docs/ && touch ./docs/.nojekyll"},"engines":{"node":">=10.0.0"},"repository":{"type":"git","url":"https://github.com//nats-io/nkeys.js"},"keywords":["nats","Ed25519","javascript"],"author":{"name":"The NATS Authors"},"license":"Apache-2.0","dependencies":{"tweetnacl":"1.0.3"},"devDependencies":{"@types/node":"^18.11.x","ava":"^5.1.x","typedoc":"^0.23.x","typescript":"^4.9.x"},"ava":{"failFast":true,"require":[],"files":["./node_test/*.js"]},"gitHead":"9b08b6f038480607e0cbaac2d6a71b8beff58f35","_id":"@conform_reward129/nkeys.js@1.0.6-rc3","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-ioc8LDx5eCrRA5FsNsEjTUnEKQ23DdVInxssRRYQzHzcxrbabzfWB0nPfbsVslN2w7Wj13RuI71B+1qHtam2YA==","shasum":"71cab789d59c00a0e6ae70eb9e1fd18f80e70558","tarball":"https://registry.npmjs.org/@conform_reward129/nkeys.js/-/nkeys.js-1.0.6-rc3.tgz","fileCount":27,"unpackedSize":109714,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCH2QW1it5m1lgIaVDUthbnDKLAfqm4YoLZCqJ7szsMI0CIQCoqWP9+DehiSWdl19WMXBATcDuCr2s549Tg3Dhtqgqpg=="}]},"_npmUser":{"name":"conform_reward129","email":"conform_reward129@mp.miknowak.pl"},"directories":{},"maintainers":[{"name":"conform_reward129","email":"conform_reward129@mp.miknowak.pl"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nkeys.js_1.0.6-rc3_1684088240856_0.298000647843949"},"_hasShrinkwrap":false}},"time":{"created":"2023-05-14T18:11:11.892Z","1.0.6-rc1":"2023-05-14T18:11:12.103Z","modified":"2023-05-14T18:17:21.103Z","1.0.6-rc2":"2023-05-14T18:15:05.152Z","1.0.6-rc3":"2023-05-14T18:17:21.004Z"},"maintainers":[{"name":"conform_reward129","email":"conform_reward129@mp.miknowak.pl"}],"description":"A public-key signature system based on Ed25519 for the NATS ecosystem in javascript","keywords":["nats","Ed25519","javascript"],"repository":{"type":"git","url":"https://github.com//nats-io/nkeys.js"},"author":{"name":"The NATS Authors"},"license":"Apache-2.0","readme":"# nkeys.js\n\nA public-key signature system based on Ed25519 for the\n[NATS ecosystem system](https://nats.io) for JavaScript.\n\n[![license](https://img.shields.io/github/license/nats-io/ts-nats.svg)](https://www.apache.org/licenses/LICENSE-2.0)\n[![nkeys.js](https://github.com/aricart/nkeys.js/workflows/nkeys.js/badge.svg)](https://github.com/aricart/nkeys.js/actions)\n[![npm](https://img.shields.io/npm/v/nkeys.js.svg)](https://www.npmjs.com/package/nkeys.js)\n[![npm](https://img.shields.io/npm/dt/nkeys.js.svg)](https://www.npmjs.com/package/nkeys.js)\n\nThe nkeys.js library works in Deno, Node.js, and the browser!\n\n## Installation\n\nFor your Deno projects:\n\n```javascript\nimport {\n  createUser,\n  fromPublic,\n  fromSeed,\n} from \"https://deno.land/x/nkeys.js/modules/esm/mod.ts\";\n```\n\nOn node, and browsers you can get a build from npm:\n\n```bash\nnpm install nkeys.js\n```\n\nIn your node projects:\n\n```javascript\nconst { createUser, fromSeed, fromPublic } = require(\"nkeys.js\");\n```\n\nOn your browser projects, make available the `node/nkeys.js/nkeys.mjs`, and then\n\n```javascript\nimport { createUser, fromPublic, fromSeed } from \"https://host/path/nkeys.mjs\";\n```\n\n## Basic Usage\n\nThe [documentation is here](https://nats-io.github.io/nkeys.js/)\n\n```typescript\n// create an user nkey KeyPair (can also create accounts, operators, etc).\nconst user = createUser();\n\n// A seed is the public and private keys together.\nconst seed: Uint8Array = user.getSeed();\n\n// Seeds are encoded into Uint8Array, and start with\n// the letter 'S'. Seeds need to be kept safe and never shared\nconsole.log(`seeds start with s: ${seed[0] === \"S\".charCodeAt(0)}`);\n\n// A seed's second letter encodes it's type:\n// `U` for user,\n// `A` for account,\n// `O` for operators\nconsole.log(`nkey is for a user? ${seed[1] === \"U\".charCodeAt(0)}`);\n\n// To view a seed, simply decode it:\nconsole.log(new TextDecoder().decode(seed));\n\n// you can recreate the keypair with its seed:\nconst priv = fromSeed(seed);\n\n// Using the KeyPair, you can cryptographically sign content:\nconst data = new TextEncoder().encode(\"Hello World!\");\nconst sig = priv.sign(data);\n\n// and verify a signature:\nconst valid = user.verify(data, sig);\nif (!valid) {\n  console.error(\"couldn't validate the data/signature against my key\");\n} else {\n  console.error(\"data was verified by my key\");\n}\n\n// others can validate using your public key:\nconst publicKey = user.getPublicKey();\nconst pub = fromPublic(publicKey);\nif (!pub.verify(data, sig)) {\n  console.error(`couldn't validate the data/signature with ${publicKey}`);\n} else {\n  console.info(`data was verified by ${publicKey}`);\n}\n\n// when extracting with seeds or private keys\n// you should clear them when done:\nseed.fill(0);\n\n// you should also clear the keypairs:\nuser.clear();\npriv.clear();\n```\n\n## Supported Node Versions\n\nOur support policy for Nodejs versions follows\n[Nodejs release support](https://github.com/nodejs/Release). We will support and\nbuild nkeys.js 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\nVersion 2.0 license found in the LICENSE file.\n","readmeFilename":"README.md"}