@extensionengine/pbzcomnet-signedfile
v1.0.3
Published
Extract & verify PBZCOM@NET balance reports
Downloads
10
Readme
@extensionengine/pbzcomnet-signedfile
Extract & verify PBZCOM@NET balance reports
Installation
npm install @extensionengine/pbzcomnet-signedfile
CLI
Extract report from signed XML envelope:
npx -p @extensionengine/pbzcomnet-signedfile report-extract <report>
Verify signed XML envelope containing balance report:
npx -p @extensionengine/pbzcomnet-signedfile report-verify <report>
API
Table of Contents
extract
Extract balance report from signed XML envelope
Parameters
xmldoc
Examples
const { extract, parse } = require('@extensionengine/pbzcomnet-signedfile');
const path = require('path');
const { readFileSync } = require('fs');
const xml = readFileSync(path.join(__dirname, './reports/1110779471-20200721.rtf.sgn'), 'utf-8');
const xmldoc = parse(xml);
extract(xmldoc).then(buffer => console.log('payload:\n', buffer.toString()));
Returns Promise<Buffer> extracted payload
verify
Verify signed XML envelope containing balance report
Parameters
xmldoc
Examples
const { parse, verify } = require('@extensionengine/pbzcomnet-signedfile');
const path = require('path');
const { readFileSync } = require('fs');
const xml = readFileSync(path.join(__dirname, './reports/1110779471-20200721.rtf.sgn'), 'utf-8');
const xmldoc = parse(xml);
const isVerified = verify(xmldoc);
console.log('result:', isVerified);
Returns boolean verification result