{"name":"@hyperswarm/hypersign","version":"2.1.0","description":"Utility methods related to public key cryptography to be used with distributed mutable storage","main":"index.js","dependencies":{"sodium-universal":"^2.0.0"},"devDependencies":{"bencode":"^2.0.1","standard":"^13.1.0","tap":"^14.5.0"},"scripts":{"test":"tap --no-esm  -R classic test/*.test.js  && standard --fix","cov":"tap --no-esm -R classic --100 test/*.test.js","ci":"standard && npm run cov"},"repository":{"type":"git","url":"git+https://github.com/hyperswarm/hypersign.git"},"author":{"name":"David Mark Clements","url":"@davidmarkclem"},"license":"MIT","bugs":{"url":"https://github.com/hyperswarm/hypersign/issues"},"homepage":"https://github.com/hyperswarm/hypersign","gitHead":"9505ebf39c395b4478937870c9b6256415c35b4c","_id":"@hyperswarm/hypersign@2.1.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-iHVUYUVo8zyzysXbWQsn6Yq0jRCKj5hkeY9qNJUq7xyps2npE8oc+Yzeq3qHQ6JD+IVbT/SOzIpE6wx0DWQ2IQ==","shasum":"b242d2327cc82620497940a61d163fcefec477d4","tarball":"http://registry-npm.ywwl.com/@hyperswarm/hypersign/download/@hyperswarm/hypersign-2.1.0.tgz","fileCount":6,"unpackedSize":13896,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd19VGCRA9TVsSAnZWagAAU2UP+wfexhGUOt1e5JccWUET\nOYgu9CKHQAuJ+qF+NJydMrVPLmX2qRP3Hi6KoXnieADWn4HX0y9YNvfxCPZI\n3S8svGGPlrwhYxkp3M7FTi2aS0vYtyWDqq/Lz7klDgCMsPDPAOArdLG+vIMe\n48OjL1TnRWbX1B0pa98ffv3IxaE8zSZXKgk7m3nsa6FAVV0iINp37Nl8MDiW\n0ZJ/I8kkzVQNsSLNZT7DCemlKuI/PhcEtn+WyrCrMC6oQEedNeJIZDUQgs20\nexlk9OJ+9PQ89Njb4UR7Q0JptqyLITOjeJuGoH7R/oyKwsbxfECJ2ZpDfkCo\nXRXlAW4OZOIQPvJI7eBwujqSUcf+c8ehXs2a4LYNoAQFvnp9eSY+OK4DUki0\naeISGpmBxZICGlTaJlxlq8bKUc+6lXO+Kq3qx9VCAtwc9IuUX/GkvM/+OOPZ\n/KltMxJZRwGfaFvQAgHTdf/RnJa2JS+6TpWmR365poXOrQ9393Vjk55RpJMS\noRu5Tgabx/bHKLOGgSGfcJXU0IxdJbn0Eetknm8HsiQWPMp1zNMn6ibHQDPJ\nwuKmU1/dGAO0cMkkTnpF9g9MoZQgQsyUsR8SSfTmud7LZ9QhBJo7mu4TyXrT\nefBTb+oHlxuNlgaZFuUHhPiIeLccrOnsyTBi+zRaLmtEzC2CB5UOR35/wb0c\nMOmJ\r\n=bfPD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHXGUf99A5psOqlVYSFjjY63F1ZehE85HlDYTHi9HTdnAiEAi09jNDjBc1ejTQ0sSDnpRY4xQQsyHx9GZGzSRowIZ6g="}],"size":3870,"noattachment":false,"key":"/@hyperswarm/hypersign/-/@hyperswarm/hypersign-2.1.0.tgz"},"maintainers":[{"name":"davidmarkclements","email":"huperekchuno@googlemail.com"},{"name":"mafintosh","email":"mathiasbuus@gmail.com"},{"name":"pfrazee","email":"pfrazee@gmail.com"}],"_npmUser":{"name":"davidmarkclements","email":"huperekchuno@googlemail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hypersign_2.1.0_1574425925968_0.2170741809967105"},"_hasShrinkwrap":false,"readme":"# @hyperswarm/hypersign\n\nUtility methods related to public key cryptography to be used with distributed mutable storage.\n\n```\nnpm install @hyperswarm/hypersign\n```\n\n## API\n\n#### `const { keypair, salt, sign, signable } = hypersign()`\n\nCall the exported function to get hypersign instance.\n\nThere is also a class `hypersign.HyperSign` which can be\nextended.\n\n#### `keypair()`\n\nUse this method to generate an assymetric keypair.\nReturns an object with `{publicKey, secretKey}`. `publicKey` holds a public key buffer, `secretKey` holds a private key buffer.\n\n#### `salt([str, ]size = 32)`\n\nUtility method for creating a random or hashed salt value.\n\nIf called with a string the string will be hashed, to a\ngeneric hash of `size` length.\n\nIf called without any inputs, or with a number, random \nbutes of `size` length will be\n\n#### `sign(value, options)`\n\nUtility method which can be used to create a `sig`.\n\nOptions:\n\n* `keypair` – REQUIRED, use `keypair` to generate this.\n* `salt` - OPTIONAL - default `undefined`, a buffer >= 16 and <= 64 bytes. If supplied it will salt the signature used to verify mutable values.\n* `seq` - OPTIONAL - default `0`. The sequence number of the value.\n\n#### `signable(value, options)`\n\nUtility method which returns the exact buffer that would be signed in by `sign`. This is only needed when using a salt, otherwise it will return the same `value` passed in. This method is to facilitate out-of-band signing (e.g. hardware signing), do not pass the returned signable value into `sign`, it already uses `signable`.\nIf you need to sign a value that has already been passed \nthrough `signable`, use `cryptoSign`.\n\nOptions:\n\n* `salt` - OPTIONAL - default `undefined`, a buffer >= 16 and <= 64 bytes. If supplied it will salt the signature used to verify mutable values.\n* `seq` - OPTIONAL - default `0`. The sequence number of the value.\n\n#### `cryptoSign(msg, keypair)`\n\nUtility method which can be used to create a signature using the `crypto_sign_detached` Sodium method. This only needs to be used \nwhen you *do not* need to apply encoding to `value`, `salt` and `seq`(e.g. if value and options have already been passed to `signable`).\n\nOptions:\n\n* `keypair` – REQUIRED, use `keypair` to generate this.\n* `salt` - OPTIONAL - default `undefined`, a buffer >= 16 and <= 64 bytes. If supplied it will salt the signature used to verify mutable values.\n* `seq` - OPTIONAL - default `0`. The sequence number of the value.\n\n## License\n\nMIT\n","publish_time":1574425926127,"_cnpm_publish_time":1574425926127,"dist-tags":{"latest":"2.1.1"}}