Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
connect-pgp
Advanced tools
A middleware for Connect.js signing HTTP responses.
var connect = require('connect');
var pgpsign = require('connect-pgp');
var armoredPrivateKey = fs.readFileSync('somePGPKey.private', 'utf8');
var app = connect();
app.use(pgpsign(armoredPrivateKey, 'password for unlocking'));
// Or, to use gpg system command as underlying PGP signature layer
app.use(pgpsign(armoredPrivateKey, 'password for unlocking', 'keyringName'));
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.
This software is provided under MIT license.
FAQs
Connect middleware to cryptographically sign HTTP responses.
The npm package connect-pgp receives a total of 1 weekly downloads. As such, connect-pgp popularity was classified as not popular.
We found that connect-pgp demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.