NFID: Can't verify a delegation

Hi all! I’m trying to verify a delegation I got from NFID playground, or from some app that’s using NFID authorization like openchat using Crypto default library… and stacking with an error - it’s always not valid. At the same time, if I generate new data with that library, it’s obviously valid. Could you please advise what I’m doing wrong?

The code:

const crypto = require('crypto');
const fs = require('fs');

// Data inserting from files
const publicKeyPem = fs.readFileSync('public.pem', 'utf8');
const signature = fs.readFileSync('signature.bin');
const data = fs.readFileSync('data.txt', 'utf8');

// Signature verification
const verify = crypto.createVerify('SHA256');
verify.update(data);
verify.end();

const isValid = verify.verify(publicKeyPem, signature);
console.log('Is Valid:', isValid);

Do appreciate your help. Thank you in advance!

@dostro, can you help here?