Dody
Dody

Reputation: 668

Invalid signature on Adobe Reader: "signer's identity has not yet been verified"

I've tried with several p12 certificates and when I sign via my Nodejs approach it returns an invalid signature on Adobe.

enter image description here

However, signing just with Adobe the signature seems to be valid (just with a warning).

enter image description here

Is there something that I'm missing?

const signer = require('node-signpdf')
const fs = require('fs')
const helpers = require('node-signpdf/dist/helpers')

const init = async () => {
    const p12Buffer = fs.readFileSync(`${__dirname}/cert.p12`);

    let pdfBuffer = fs.readFileSync(`${__dirname}/test.pdf`);
        pdfBuffer = helpers.plainAddPlaceholder({
        pdfBuffer,
        signatureLength: 31280,
    });

    pdfBuffer = signer.default.sign(pdfBuffer, p12Buffer, {
        passphrase: 'reingenio'
    });

    fs.writeFileSync(`${__dirname}/signed.pdf`, pdfBuffer)
}

init()

Thanks.

Upvotes: 0

Views: 960

Answers (1)

LelisJ
LelisJ

Reputation: 1

Did you tried read the pdf file as binary ? fs.readFileSync(${__dirname}/test.pdf, 'binary');

Upvotes: 0

Related Questions