zpi-ifind
v2.0.0
Published
Utils to integrate ifind with zpi
Downloads
3
Readme
ZPI IFIND
Usage
- Install package
$ npm i zpi-ifind
- Generate key
const { generateKey } = require('zpi-ifind');
generateKey('ifind.private.pem', 'ifind.public.pem');
Exchange public key file with zpi
Get data from query param
d
let data = req.query.d;
- Decrypt and verify data to get user info
const {
loadPrivateKey,
loadPublicKey,
decryptAndVerify
} = require('zpi-ifind');
const ifindPrivate = loadPrivateKey('ifind.private.pem');
const zpiPublic = loadPublicKey('zpi.public.pem');
const message = decryptAndVerify(
data,
ifindPrivate,
zpiPublic
);