0.3.1 • Published 10 years ago

connect-pgp v0.3.1

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

Connect-pgp

A middleware for Connect.js signing HTTP responses.

Usage

var connect = require('connect');
var pgpsign = require('connect-pgp');

// This is your super signing own function!
function doSign(msg, callback) {
  // Do signing stuff...
  callback(err, pgpSignedMessage);
}

// New connect app
var app = connect();

// Now signing HTTP requests!
app.use(pgpsign(doSign));

Triggering

Middleware triggers on HTTP header:

"Accept: multipart/signed"

then answers:

  HTTP/1.1 200 OK
  Content-Type: multipart/signed; boundary=bar; micalg=pgp-sha1; protocol="application/pgp-signature"

  --bar
  Content-Type: text/plain; charset=iso-8859-1
  Content-Transfer-Encoding: quoted-printable
  
& This is the body content.
& 
& Every word and every space in the body content body will be
& signed, even the two fields "Content-Type" and "Content-Transfer-Encoding"
& above, with the new line before this body content.

  --bar
  Content-Type: application/pgp-signature
  
  -----BEGIN PGP MESSAGE-----
  Version: 2.6.2

  iQCVAwUBMJrRF2N9oWBghPDJAQE9UQQAtl7LuRVndBjrk4EqYBIb3h5QXIX/LC//
  jJV5bNvkZIGPIcEmI5iFd9boEgvpirHtIREEqLQRkYNoBActFBZmh9GC3C041WGq
  uMbrbxc+nIs1TIKlA08rVi9ig/2Yh7LFrK5Ein57U/W72vgSxLhe/zhdfolT9Brn
  HOxEa44b+EI=
  =ndaj
  -----END PGP MESSAGE-----
  
  --bar--

N.B.: the part of the response with '&' is what is signed.

License

This software is provided under MIT license.

0.3.1

10 years ago

0.3.0

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.15

11 years ago

0.1.14

11 years ago

0.1.13

11 years ago

0.1.12

11 years ago

0.1.11

11 years ago

0.1.10

11 years ago

0.1.9

11 years ago

0.1.8

11 years ago

0.1.7

11 years ago

0.1.6

11 years ago

0.1.5

11 years ago

0.1.4

11 years ago

0.1.3

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago