Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect formatting status #44

Open
microshine opened this issue Feb 21, 2023 · 0 comments
Open

Incorrect formatting status #44

microshine opened this issue Feb 21, 2023 · 0 comments

Comments

@microshine
Copy link
Contributor

The verify.pdf file has Document structure doesn't match PDF specification. status in verification result.

Looks like it's wrong.

const crypto = new Crypto();

// Set crypto engine for PKIjs module
pkijs.setEngine("NodeJS", new pkijs.CryptoEngine({ crypto }));

// Set crypto engine for X509 module
x509.cryptoProvider.set(crypto);

// Read the PDF document
const raw = fs.readFileSync(path.resolve(__dirname, "files", "verify.pdf"));
const doc = await pdfDoc.PDFDocument.load(raw);

const sigStatus = await doc.verify({
  checkDate: new Date("2023-02-22"),
});

console.log(sigStatus);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant