A JavaScript library for creating and verifying HTTP Signature headers
To install locally (for development):
git clone https://github.com/digitalbazaar/http-signature-header.git
cd http-signature-header
npm install
import {
createAuthzHeader, createSignatureString
} from '@digitalbazaar/http-signature-header';
const requestOptions = {
url,
method: 'POST',
headers
}
const includeHeaders = ['expires', 'host', '(request-target)'];
const plaintext = createSignatureString({includeHeaders, requestOptions});
const data = new TextEncoder().encode(plaintext);
const signature = base64url.encode(await signer.sign({data}));
const Authorization = createAuthzHeader({
includeHeaders,
keyId: signer.id,
signature
});
Please follow the existing code style.
PRs accepted.
If editing the Readme, please conform to the standard-readme specification.
Commercial support for this library is available upon request from Digital Bazaar: support@digitalbazaar.com
BSD-3-Clause © Digital Bazaar