{"_id":"@aayu-tech/json-sign","_rev":"3-242e45e5790868b387603534e10318c2","name":"@aayu-tech/json-sign","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@aayu-tech/json-sign","version":"1.0.0","description":"A utility that can be used to generate a signature for a JSON object and to validate such a signature","main":"index.js","types":"index.d.ts","scripts":{"test":"mocha index.test.js"},"repository":{"type":"git","url":"git+https://github.com/aayu-technologies/json-sign.git"},"keywords":["json","signature"],"author":{"name":"Aayu Tech","email":"info@aayutechnologies.com"},"license":"MIT","bugs":{"url":"https://github.com/aayu-technologies/json-sign/issues"},"homepage":"https://github.com/aayu-technologies/json-sign#readme","dependencies":{"node-rsa":"1.1.1"},"devDependencies":{"mocha":"^9.0.2"},"gitHead":"d26eefc26784b9fcb1c74f30435d0138afe00219","_id":"@aayu-tech/json-sign@1.0.0","_nodeVersion":"12.19.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-MDgsuAa84jjluc/62KzUE8odHEtrVTaNomRrpJnf9tDfPrl6bWzXNIgM2AtP1X7Pa2O9pYWxK/QqN5czyRzfEw==","shasum":"b1f5e7719f364636f173bd23ac5146a58a769fcb","tarball":"https://registry.npmjs.org/@aayu-tech/json-sign/-/json-sign-1.0.0.tgz","fileCount":5,"unpackedSize":7284,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+US0CRA9TVsSAnZWagAAelsP+QAFSjPLg/ew+0lzDazr\n9b4cPZ7OsNxhGdbe4dZVFhNoeqFNXfzTOp0pEa0T3jCaPDMhjrAsoEJUs4lH\nCWlAhUgd8x4qBPV9aBrGgT3lkzRw1WdOzaPUJVWCSMg+G43CWkNDE4e07dlv\nIZUnf+n6X3uqSLLmxoJi9KApVUKnjLieBBU4K3UqWSm1HWkr9KyWwKSj9Kee\nhGGMS8dCEPWvT/lD2TayKAZNt+3hLWJesOXv6D665njv2s1CPiDxzIbfzbCn\niD2GHtlnpL3IKDH2RZZ7cUET0iG+Z/hLQB/2rEH6hfpo5L8appdOjyOK6c5v\n128IW8UUuV3RxeeyPX5zZs36UBiL16LrTfhDX7Bv81EPSndSgnkeVQwgKAVJ\nCG/6axjiO3eF5JBGTCDchJpr2zVpZc+OWOPB03x2vGQDUmbsvL0ntRiLF9Cn\nhrTYodAGoChP6JCxk+57ykWChLNju+YtmgO9EmQrgbYG9SKqFgEpmAgPQx21\nlL+h4ed6OQ9N5sZefxjn4Z/IsJOIUv/37xfv7vjy01i5ixuam3J7BygKLZOg\nGuT1pYINK6vP2uQ7sqyhdun19hMYEUZVsUeEsKiTJy2PHRXPn+iP+cdGOsl6\nTSpDEjgRNebhxX7+kibtUZt4Al5k9ZQUrkLkUENM7dpyQPutE7xOIUDTJ5oA\nW9N+\r\n=gC/L\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDijHTpPDYkssTKQNk8hQeH5btrHRtTfHhNBzgNDUqGigIgSpMigLEqtdQM2BGh/W8NlvfpRnW8RI0e+c01logvTSs="}]},"_npmUser":{"name":"aayu-tech-publisher","email":"npm@aayutechnologies.com"},"directories":{},"maintainers":[{"name":"aayu-tech-publisher","email":"npm@aayutechnologies.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/json-sign_1.0.0_1626948788665_0.6919308452527384"},"_hasShrinkwrap":false},"1.0.1":{"name":"@aayu-tech/json-sign","version":"1.0.1","description":"A utility that can be used to generate a signature for a JSON object and to validate such a signature","main":"index.js","types":"index.d.ts","scripts":{"test":"mocha index.test.js"},"repository":{"type":"git","url":"git+https://github.com/aayu-technologies/json-sign.git"},"keywords":["json","signature"],"author":{"name":"Aayu Tech","email":"info@aayutechnologies.com"},"license":"MIT","bugs":{"url":"https://github.com/aayu-technologies/json-sign/issues"},"homepage":"https://github.com/aayu-technologies/json-sign#readme","dependencies":{"node-rsa":"1.1.1"},"devDependencies":{"mocha":"^9.0.2"},"gitHead":"984c08c13ce603e9b74d6b21fc5257edf90ed635","_id":"@aayu-tech/json-sign@1.0.1","_nodeVersion":"14.17.5","_npmVersion":"6.14.14","dist":{"integrity":"sha512-Jmvqsb3cUjuEcie2jkhy/FThdNaEbgYfAiqXgd7gcTBzbPoHI1pp2l9IW6zIdC5smGcu2190AJP0TjiD+GX13g==","shasum":"b422e73989f1f75b9e8f4d75c23bd8407e2524a1","tarball":"https://registry.npmjs.org/@aayu-tech/json-sign/-/json-sign-1.0.1.tgz","fileCount":5,"unpackedSize":7280,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhuxtFCRA9TVsSAnZWagAAL58QAKHzTOulyO2WRnzjzcpp\nICVKI0erMtJXu4XfEhDLbq0UcnGeyK/3q1RwmiNLOyq4rHc8aWE/F3rZ5C2s\n3sWU1BbrXm6aeKD6T/0QqTgzlOb573qgoevI60jYseldE6IRqSApEty1s1wn\nZBThoLgXp4fpA7Fx4oAOcmVtnRpSQZzFMFF7bNL8RAWamvQBpl8xzrVcyGc8\nFU+zsGyYzR5UyYSF8mpCEd7Huc1IUpmvKnERipD6K7Ia/C0mOV46MLJhpks3\np7XikTnimiQtlz+f4kybQJpou6q28/XqWlcnYc16QAUiSCkz+hJyKK4FbIrZ\nNjg7gS7LFPDf12NuXbZL/ldLzOn9Es46+kSGQH2vCbfmdIcca4hlkXUIyaYZ\nGKpe8BOEcI3FPOkRAP8zFKbrigs650T6H7mvLyXleQHFLp1ofEraYcCkeamu\nlDQfeCIauOl+beY4pM/S4rvLQvHcep5YEAFpCIIteoWxqsgBrqMkjpp55pah\nzGaR3mPhig7yteOPs9l+dCbIrlMAk5HkLbOBbQ0YNwvwpIRClWERRAQyYQD3\nP2xFIdJpaM3Rh7w70LzycxcDklhGgGllmXNBk3hr0Prisaj8EQzhhEjxHdgi\nHu6Rc/+kIi4xdGypWN+e71FWFAS2Up16xfElF9KHg5zfrZGhU1yQdyWgVRAA\nHvDN\r\n=eCLN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAgDCoVO/uAfbIa69KrIdlBIGbzB96yA9f827ujrcf0MAiBBTEKicq10ul8PYjykksJGa6pTslRuNB2NT1mMyybcIw=="}]},"_npmUser":{"name":"aayu-tech-publisher","email":"npm@aayutechnologies.com"},"directories":{},"maintainers":[{"name":"aayu-tech-publisher","email":"npm@aayutechnologies.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/json-sign_1.0.1_1635742763095_0.8131317675882423"},"_hasShrinkwrap":false}},"time":{"created":"2021-07-22T10:13:08.622Z","1.0.0":"2021-07-22T10:13:08.799Z","modified":"2022-04-04T10:56:28.776Z","1.0.1":"2021-11-01T04:59:23.228Z"},"maintainers":[{"name":"aayu-tech-publisher","email":"npm@aayutechnologies.com"}],"description":"A utility that can be used to generate a signature for a JSON object and to validate such a signature","homepage":"https://github.com/aayu-technologies/json-sign#readme","keywords":["json","signature"],"repository":{"type":"git","url":"git+https://github.com/aayu-technologies/json-sign.git"},"author":{"name":"Aayu Tech","email":"info@aayutechnologies.com"},"bugs":{"url":"https://github.com/aayu-technologies/json-sign/issues"},"license":"MIT","readme":"# JSON Sign\n\nThis is a utility that can be used to generate a signature for a JSON object and to verify such a signature against a\nJSON object.\n\n## Installation\n\nThis module can be installed via NPM.\n\n`npm install @aayu-tech/json-sign --save`\n\n## Generating a key-pair\n\nA private-public key pair is required for the signing and verification operations. You can generate such a key pair\nusing `openssl` as follows.\n\n#### Generate Private Key\n`openssl genrsa -out private.pem 2048`\n\nThis will generate a Private Key and store it in to the `private.pem` file.\n\n#### Export the Public Key\n`openssl rsa -in private.pem -outform PEM -pubout -out public.pem`\n\nThis will export the Public key of the previously created Private Key it in to the `public.pem` file.\n\n## Generate a Signature\n\n#### By providing Private Key content\n\n```\nconst {getSignatureByKey} = require('@aayu-tech/json-sign');\n\nconst obj = {a: 123, b: \"foo\", c: true};\nconst signature = getSignatureByKey(obj, '-----BEGIN RSA PRIVATE KEY-----\\nMIIEowIBAA....\\n-----END RSA PRIVATE KEY-----\\n');\n```\n\n#### By providing Private Key file path\n\n```\nconst {getSignatureByKeyFile} = require('@aayu-tech/json-sign');\n\nconst obj = {a: 123, b: \"foo\", c: true};\nconst signature = getSignatureByKeyFile(obj, 'private.pem');\n```\n\n## Verify a Signature\n\n#### By providing Signature and Public Key content\n\n```\nconst {verifySignatureByKey} = require('@aayu-tech/json-sign');\n\nconst obj = {a: 123, b: \"foo\", c: true};\nconst signature = 'kZNzGnfoFYqunxRo/CPoSep6TXfbhtkqACYX70D1leh/bRe+AAI.......';\nconst isValid = verifySignatureByKey(obj, signature, '-----BEGIN PUBLIC KEY-----\\nMIIBIjAN......\\n-----END PUBLIC KEY-----');\n```\n\n#### By providing Signature and Public Key file path\n\n```\nconst {verifySignatureByKeyFile} = require('@aayu-tech/json-sign');\n\nconst obj = {a: 123, b: \"foo\", c: true};\nconst signature = 'kZNzGnfoFYqunxRo/CPoSep6TXfbhtkqACYX70D1leh/bRe+AAI.......';\nconst isValid = verifySignatureByKeyFile(obj, signature, 'public.pem');\n```\n\n","readmeFilename":"README.md"}