{"name":"@hyperswarm/hypersign","version":"0.0.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":{"standard":"^13.1.0","tap":"^14.5.0"},"scripts":{"test":"tap  -R classic test/*.test.js  && standard --fix","cov":"tap -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":"f298f1c81b71d9bfe03ea8326d7b567f6d7291a1","_id":"@hyperswarm/hypersign@0.0.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-kTZ1K0B3yPdsCokGh7U4a0GoCu90BODX79N6Wagc1bZZwQgoAC2SSPQfKOmVOBtrVbTw2cBBlXLOSm03FzMOvw==","shasum":"98c9e827ba7ac365d0a9965761e413e54872490c","tarball":"http://registry-npm.ywwl.com/@hyperswarm/hypersign/download/@hyperswarm/hypersign-0.0.0.tgz","fileCount":6,"unpackedSize":9668,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdUv+pCRA9TVsSAnZWagAAqcMP/2q4BLQEd4U5EiGdNaQp\nXxd+MVwfHhp6dXWl823PN8Yc4jB2Fo290i/K7fnr48FwmhCceUBVDNdrTX+5\n8jiNcvFvE4np9804F3bzAZnxxmisA19qwr3z1eg/E+EHiGbeCXUOWTL6/Sly\npAkKmdfqhlhUMcJqByNfoihhgbVbgsheWhQopJd22wuDJ3pOu0qOJbZqMJDO\nP6mtunBIXBSht7Z7lorRDFl8DovyKFK4w3cg0qh7DueKR1XLUcZZjF4J6Xwo\nj4HtYKXjAZ+OYpyYniHMvkfW6dwNu04rsoCbiwHZuAN1rRvBLXWeN8cRJlDR\nm+Sl21QF3l3YU6Ys+0pNVINSH8a7H96s0FYXqu1McENwvF18x6nzRvvDgmha\n1k8EAxlAGx0xYVm+mWxeQUVO+ImdSAP83lRToJ7FnmY+K1wTnPNi3/r3oJas\nQ4DDV4hhqZ9CnvB4DT7pepp91qklqR8vPISE42NWP6ypHKUH/ZJ+oqrHjfhc\nIurjtudhqmo+kvtTB4TeFzb3iz927TRGVKGd+ku3ABcG8x2o415JJm4ZBgKn\nwWSsU0Ur7Zr9JpESe6vHsm3rcE9BIL3a6tO0zsOBHzFGvp6G02kO2M+ZYuxm\nVAA+LljDwF0FQ124aIJcXE2ijwAoK8c4zxB+dtQSU2IX6hAjltkTWLZr9AMl\nM4Zk\r\n=USVs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHt+IU8Ke5/RHBDsx493bMtgtLPuLut6nbtHNOme+C4UAiEA/VoNGjrSmcPeDYSFB+NQ4MAIistxvxNZvjJDr/I8FIo="}],"size":3159,"noattachment":false,"key":"/@hyperswarm/hypersign/-/@hyperswarm/hypersign-0.0.0.tgz"},"maintainers":[{"name":"davidmarkclements","email":"huperekchuno@googlemail.com"},{"name":"pfrazee","email":"pfrazee@gmail.com"},{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmUser":{"name":"davidmarkclements","email":"huperekchuno@googlemail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hypersign_0.0.0_1565720489202_0.7697925147533795"},"_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":1565720489322,"_cnpm_publish_time":1565720489322,"dist-tags":{"latest":"2.1.1"}}