{"name":"http-signature","description":"Reference implementation of Joyent's HTTP Signature scheme.","version":"1.4.0","license":"MIT","author":{"name":"MNX Cloud","url":"mnx.io"},"contributors":[{"name":"Mark Cavage","email":"mcavage@gmail.com"},{"name":"David I. Lehn","email":"dil@lehn.org"},{"name":"Patrick Mooney","email":"patrick.f.mooney@gmail.com"}],"repository":{"type":"git","url":"git://github.com/TritonDataCenter/node-http-signature.git"},"homepage":"https://github.com/TritonDataCenter/node-http-signature/","bugs":{"url":"https://github.com/TritonDataCenter/node-http-signature/issues"},"keywords":["https","request"],"engines":{"node":">=0.10"},"main":"lib/index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"assert-plus":"^1.0.0","jsprim":"^2.0.2","sshpk":"^1.18.0"},"devDependencies":{"tap":"0.4.2","uuid":"^2.0.2"},"_id":"http-signature@1.4.0","gitHead":"078905cfbbf4231bcf0f6c48c4272e2df092d44d","_nodeVersion":"18.18.2","_npmVersion":"9.8.1","dist":{"integrity":"sha512-G5akfn7eKbpDN+8nPS/cb57YeA1jLTVxjpCj7tmm3QKPdyDy7T+qSC40e9ptydSWvkwjSXw1VbkpyEm39ukeAg==","shasum":"dee5a9ba2bf49416abc544abd6d967f6a94c8c3f","tarball":"http://registry-npm.ywwl.com/http-signature/download/http-signature-1.4.0.tgz","fileCount":8,"unpackedSize":38551,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDXfroC5osRVRZujp1iJHnMmLJvlPNkWMJLv2/TMaxuIAIgUI5OUiO9v122QfiVgo2Df1GEP28GhWZo1qWUrrOH9yI="}],"size":10109,"noattachment":false,"key":"/http-signature/-/http-signature-1.4.0.tgz"},"_npmUser":{"name":"bahamat","email":"bahamat@digitalelf.net"},"directories":{},"maintainers":[{"name":"bahamat","email":"bahamat@digitalelf.net"},{"name":"todd.whiteman","email":"todd.whiteman@joyent.com"},{"name":"kusor","email":"kusorbox@gmail.com"},{"name":"michael.hicks","email":"michael.hicks@joyent.com"},{"name":"pfmooney","email":"pmooney@pfmooney.com"},{"name":"mcavage","email":"mcavage@gmail.com"},{"name":"arekinath","email":"alex@cooperi.net"},{"name":"melloc","email":"melloc@writev.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-signature_1.4.0_1700084011427_0.9247923507525606"},"_hasShrinkwrap":false,"readme":"# node-http-signature\n\nnode-http-signature is a node.js library that has client and server components\nfor Joyent's [HTTP Signature Scheme](http_signing.md).\n\n## Usage\n\nNote the example below signs a request with the same key/cert used to start an\nHTTP server. This is almost certainly not what you actually want, but is just\nused to illustrate the API calls; you will need to provide your own key\nmanagement in addition to this library.\n\n### Client\n\n```js\nvar fs = require('fs');\nvar https = require('https');\nvar httpSignature = require('http-signature');\n\nvar key = fs.readFileSync('./key.pem', 'ascii');\n\nvar options = {\n  host: 'localhost',\n  port: 8443,\n  path: '/',\n  method: 'GET',\n  headers: {}\n};\n\n// Adds a 'Date' header in, signs it, and adds the\n// 'Authorization' header in.\nvar req = https.request(options, function(res) {\n  console.log(res.statusCode);\n});\n\n\nhttpSignature.sign(req, {\n  key: key,\n  keyId: './cert.pem',\n  keyPassphrase: 'secret' // (optional)\n});\n\nreq.end();\n```\n\n### Server\n\n```js\nvar fs = require('fs');\nvar https = require('https');\nvar httpSignature = require('http-signature');\n\nvar options = {\n  key: fs.readFileSync('./key.pem'),\n  cert: fs.readFileSync('./cert.pem')\n};\n\nhttps.createServer(options, function (req, res) {\n  var rc = 200;\n  var parsed = httpSignature.parseRequest(req);\n  var pub = fs.readFileSync(parsed.keyId, 'ascii');\n  if (!httpSignature.verifySignature(parsed, pub))\n    rc = 401;\n\n  res.writeHead(rc);\n  res.end();\n}).listen(8443);\n```\n\n## Installation\n\n    npm install http-signature\n\n## License\n\nMIT.\n\n## Bugs\n\nSee <https://github.com/joyent/node-http-signature/issues>.\n","publish_time":1700084011601,"_cnpm_publish_time":1700084011601,"dist-tags":{"latest":"1.4.0"}}