diff --git a/src/utils.js b/src/utils.js index 11c29c76d552305e59ff9c0b099e023918cbb6f8..32246a9b429d51a9f889a22ac514e840b0e878ef 100644 --- a/src/utils.js +++ b/src/utils.js @@ -132,7 +132,7 @@ export const readArrayBufferFileContent = async (file) => { */ export const getPDFSignatureCount = async (file) => { const sigRegex = new RegExp( - '/Type\\s*/Sig[\\s\\S]*?/SubFilter\\s*(/ETSI\\.CAdES\\.detached|/adbe\\.pkcs7\\.detached)', + '(/Type\\s*/Sig|/Filter\\s*/Adobe.PPKLite)[\\s\\S]*?/SubFilter\\s*(/ETSI\\.CAdES\\.detached|/adbe\\.pkcs7\\.detached)', 'g' ); const content = await readBinaryFileContent(file); diff --git a/test/unit.js b/test/unit.js index 82895c19a7fd4b7ab745babfc93ba0e7f6ebad93..4b806d512ca14fb7b0d24bb2865022061af651bf 100644 --- a/test/unit.js +++ b/test/unit.js @@ -76,7 +76,7 @@ suite('pdf signature detection', () => { return getPDFFile(await resp.arrayBuffer()); } - assert.equal((await getPDFSignatureCount(await getRealPDFFile('QPDF-367-0.pdf'))), 0); + assert.equal((await getPDFSignatureCount(await getRealPDFFile('QPDF-367-0.pdf'))), 1); assert.equal((await getPDFSignatureCount(await getRealPDFFile('qual-sig-simple.pdf'))), 1); assert.equal((await getPDFSignatureCount(await getRealPDFFile('qual-sig-tugraz-multiple.pdf'))), 2); });