Invalid signature after adding DSS dictionary to signed PDF

33 Views Asked by At

I want to create DSS dictionary for my signed PDF to add OCSPs and Certs into it make the PDF ltv enabled.

But after adding DSS to PDF(with/without OCSPs), acrobat reader give below error.

"Error during signature verification.

Signature contains incorrect, unrecognized, corrupted or suspicious data. Support Information: SigDict /Contents illegal data"

I used pdf-lib library to create DSS dict.

Is below correct way of doing it?

const { PDFDocument, PDFName } = require('pdf-lib');
const addOcspResponsesToDss = async () => {
const pdfDoc = await PDFDocument.load(existingPdfBytes);
 let dssDict = pdfDoc.catalog.lookup(PDFName.of('DSS'));
 if (!dssDict) {
  dssDict = pdfDoc.context.obj({
  Type: 'DSS',
  V: 1
  });
  pdfDoc.catalog.set(PDFName.of('DSS'), dssDict);
}

Thanks in advance.

PDF : https://drive.google.com/file/d/1cmghaFzE84sXG-UCOvtWcZxYphunXxGp/view?usp=sharing

0

There are 0 best solutions below