http-signature

WebJar for http-signature

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

http-signature
Последняя версия

Последняя версия

1.2.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

http-signature
WebJar for http-signature
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/joyent/node-http-signature

Скачать http-signature

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/http-signature/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>http-signature</artifactId>
    <version>1.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/http-signature/
implementation 'org.webjars.npm:http-signature:1.2.0'
// https://jarcasting.com/artifacts/org.webjars.npm/http-signature/
implementation ("org.webjars.npm:http-signature:1.2.0")
'org.webjars.npm:http-signature:jar:1.2.0'
<dependency org="org.webjars.npm" name="http-signature" rev="1.2.0">
  <artifact name="http-signature" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='http-signature', version='1.2.0')
)
libraryDependencies += "org.webjars.npm" % "http-signature" % "1.2.0"
[org.webjars.npm/http-signature "1.2.0"]

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
org.webjars.npm : assert-plus jar [1.0.0,2)
org.webjars.npm : jsprim jar [1.2.2,2)
org.webjars.npm : sshpk jar [1.7.0,2)

Модули Проекта

Данный проект не имеет модулей.

node-http-signature

node-http-signature is a node.js library that has client and server components for Joyent's HTTP Signature Scheme.

Usage

Note the example below signs a request with the same key/cert used to start an HTTP server. This is almost certainly not what you actually want, but is just used to illustrate the API calls; you will need to provide your own key management in addition to this library.

Client

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();

Server

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);

Installation

npm install http-signature

License

MIT.

Bugs

See https://github.com/joyent/node-http-signature/issues.

org.webjars.npm

Joyent

Версии библиотеки

Версия
1.2.0
1.1.1
1.1.0
0.11.0
0.10.1