signatures

0.0.2 • Public • Published

Proof of concept / testing only!

Usage:

var signature = require("signatures");

var requestParams = {
    hostname: host,
    path: '/',
    port: 8081,
    method: "POST",
    headers: {
        'content-type': 'application/json',
        'date': new Date().toUTCString(),
    }
}

var sign = signature(
    'my-key', // keyId
    '6Jj3c7lQr6dhDf4oMsYnTfrjFnwezP4GzqHlqr2heyw=', // key
    'hmac-sha256', // Hashing algorithm
    ['date', '(request-target)'] // Headers to sign
);

var signature = sign(requestParams);
requestParams.headers.authorization = signature;

var req = http.request(requestParams)
// ... etc

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.2
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.2
    2
  • 0.0.1
    1
  • 0.0.0
    1

Package Sidebar

Install

npm i signatures

Weekly Downloads

4

Version

0.0.2

License

ISC

Last publish

Collaborators

  • karboh