0.1.3 • Published 7 years ago

fpad-signatures v0.1.3

Weekly downloads
2
License
Apache-2.0
Repository
github
Last release
7 years ago

fpad-signatures

Create and verify RS256 based JWT oauth-jwt-bearer client authentications.

Installation

npm install fpad-signatures

Require Usage

var fsig = require('fpad-signatures');

API

generate(audit, key, headers)

Generate a signed audit with the given headers and the client's private key. The generate function appends a Json Web Token (JWT) to the audit's signatures.

Parameters

audit {Object} A food safety audit per the Framework for Produce Audit Data (FPAD).

key {PEM JWK} The key used to sign the audit. Supported key types include those supported by kjur/jsrsasign's KJUR.KEYUTIL.getKey function. If the JWK has a kid property it will be included in the client assertion header.

headers {Object} The headers parameter is passed directly to kjur/jsrsasign. This module will not allow the caller to override the properties required by the jwt-bearer RFC. You can add properties to the header and claim set with the following sub-objects: