@quan-to/chevronlib
v1.3.1
Published
Chevron GPG Library Wrapper for Node.JS
Downloads
7
Readme
ChevronLib Node.JS Wrapper
Installation
npm i @quan-to/chevronlib
Usage
const chevron = require('@quan-to/chevronlib');
const payloadToSign = "HUEBR";
function toBase64(data) {
const buff = Buffer.from(data);
return buff.toString('base64');
}
(async() => {
console.log('Generating key');
const key = await chevron.generateKey('123457890', 'Test Key', 2048);
console.log('Loading key');
const fingerprint = await chevron.loadKey(key);
console.log(`Unlocking key ${fingerprint}`);
await chevron.unlockKey(fingerprint, '123457890');
console.log('Signing data "${payloadToSign}"');
const signature = await chevron.signData(toBase64(payloadToSign), fingerprint);
console.log(`Validating signature: ${signature}`);
const verification = await chevron.verifySignature(toBase64(payloadToSign), signature);
console.log(`Signature is valid: ${verification}`);
})();
Building for release
TODO