A simple script that will generate httpsig headers for your request.
Run yarn
to install dependencies, then import the signatureModule.js
module into an interactive node instance. It exports the following functions: generateTestKeys
and generateSigHeaders
generateTestKeys()
: Takes no parameters. Use this to generate the private key that will be used to create the signature and the public key that will be passed to a server to verify it.- Returns two JWKs like so:
{ privateKey, publicKey }
- Returns two JWKs like so:
generateSigHeaders(privateKey: JWK, path: string, method: string, body: Object, authorization: string)
: Used to generate the headers of a signed request using httpsig. Returns aheaders
object containing said headers, as well as thechallenge
that was signed.{ headers: Object, challenge: string }