Invalid signature after adding DSS dictionary to signed PDF #1533
Unanswered
rajathrjoshi
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
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);
}
Am I doing something wrong here?
Beta Was this translation helpful? Give feedback.
All reactions