koa-pgp
Pretty good middlware privacy
npm install koa-pgp
dependencies
npm install koa-bodyparser-secure
Basic Middleware Example
- Requires a content-type of application/pgp-encrypted with koa-bodyparser-secure installed
## Advance Middleware Example
- Requires a content-type of application/pgp-encrypted with koa-bodyparser-secure installed
- Requires a PGP-Identifier
Basic Example
'use strict';const APP = ;const FS = ;const KOAPGP = ;const PARSER = ; APP; APP; let { return { let file_path = './example_files/' + file_name; FS; };}; let { return { FS; };}; APP; APP; APP; APP; APP;
As Basic Middleware
'use strict';const CONFIG = ; const FS = ;const SECUREPARSER = ; module{ FS;};
Advance Middleware
'use strict'; const CONFIG = ; const FS = ;const SECUREPARSER = ; // requires a content-type of application/pgp-encrypted module { let { return { try FS; catch err console; ; }; }; // Header Content-Type required of application/pgp-encrypted // Header PGP-Identifier required APP; APP; APP; // Lookups up the key with a designated key server; it's default is set to pgp.mit.edu APP; APP; let injection = {}; injectionstatus = 200; APP; APP; console; };
Further Examples
See example.js -- injection arguments will soon be added
Functions
- middleware(private_key, passphrase, injection)
- middleware_out(public_key, injection)
- middleware_lookup_pubkey(options, promiseFunction)
- options: header_key, hkp_server
- Defaults hkp_server to lookup Public Key at pgp.mit.edu
- Defaults header_key to 'PGP-Identifier' as header parameter expected
- middleware_injection(promiseFunction)
Want to contribute to this repository? Submit a pull request!
What's still needed?
- Unit Tests
- A standard to convert PGP messsages to JSON
Full Examples
- TBA
Authors
License
MIT