Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Mar 1, 2024 via pnpm

http-signature 0.9.9

Reference implementation of Joyent's HTTP Signature Scheme
Package summary
Share
6
issues
3
critical severity
license
3
2
high severity
vulnerability
2
1
moderate severity
meta
1
1
license
3
N/A
Package created
14 Jul 2011
Version published
19 Mar 2012
Maintainers
8
Total deps
3
Direct deps
2
License
UNKNOWN

Issues

6

3 critical severity issues

critical
Recommendation: Check the package code and files for license information
via: asn1@0.1.11
Recommendation: Check the package code and files for license information
via: ctype@0.5.0
Recommendation: Check the package code and files for license information
via: http-signature@0.9.9
Collapse
Expand

2 high severity issues

high
Recommendation: Upgrade to version 0.10.0 or later
via: http-signature@0.9.9
Recommendation: Upgrade to version 0.10.0 or later
via: http-signature@0.9.9
Collapse
Expand

1 moderate severity issue

moderate
via: ctype@0.5.0
Collapse
Expand

Licenses

N/A

N/A
3 Packages, Including:
asn1@0.1.11
ctype@0.5.0
http-signature@0.9.9
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

2
All Dependencies CSV
β“˜ This is a list of http-signature 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
asn10.1.117.67 kBUNKNOWN
prod
1
ctype0.5.050 kBUNKNOWN
prod
1
1

Visualizations

Frequently Asked Questions

What does http-signature do?

HTTP Signature is an npm package offering a node.js library with client and server components for Joyent's HTTP Signature Scheme. This package allows you to authorize and validate incoming HTTP requests based on a signature contained in the HTTP header helping you increase the security of your applications.

How do you use http-signature?

To use the HTTP Signature package, you start by installing it on your node.js project using the npm install command as follows: npm install http-signature.

For client-side usage, you first require the necessary modules and read your private key. Then, you specify your request options, sign the request with your key, and send it.

var fs = require('fs');
var https = require('https');
var httpSignature = require('http-signature');

var key = fs.readFileSync('./key.pem', 'ascii');

var options = {
  host: 'localhost',
  port: 8443,
  path: '/',
  method: 'GET',
  headers: {}
};

//Adds a 'Date' header in, signs it, and adds the Authorization' header in.
var req = https.request(options, function(res) {
  console.log(res.statusCode);
});

httpSignature.sign(req, {
  key: key,
  keyId: './cert.pem',
  keyPassphrase: 'secret' // optional
});

req.end();

For server-side usage, you parse the incoming request and verify its signature. If the signature is verified, then you proceed with handling the request, if not; you respond with an Unauthorized status (401).

var fs = require('fs');
var https = require('https');
var httpSignature = require('http-signature');

var options = {
  key: fs.readFileSync('./key.pem'),
  cert: fs.readFileSync('./cert.pem')
};

https.createServer(options, function (req, res) {
  var rc = 200;
  var parsed = httpSignature.parseRequest(req);
  var pub = fs.readFileSync(parsed.keyId, 'ascii');

  if (!httpSignature.verifySignature(parsed, pub))
    rc = 401;

  res.writeHead(rc);
  res.end();
}).listen(8443);

Where are the http-signature docs?

The official documentation for the HTTP Signature package isn't explicitly mentioned in the readme content, but as it's an open-source project, information regarding the usage and details about the package could be found on their GitHub repository at git://github.com/joyent/node-http-signature.git. Additionally, the code examples provided in the repository are a good resource for understanding how to utilize this package.