diff --git a/src/api/addAttachedSignature.test.ts b/src/api/addAttachedSignature.test.ts index 620a696..ddb04f0 100644 --- a/src/api/addAttachedSignature.test.ts +++ b/src/api/addAttachedSignature.test.ts @@ -31,6 +31,7 @@ const executionFlow = { propset_ContentEncoding: jest.fn(), propset_Content: jest.fn(), SignCades: jest.fn(() => executionSteps[4]), + VerifyCades: jest.fn(), CoSignCades: jest.fn(() => executionSteps[5]), }, [executionSteps[2]]: { diff --git a/src/api/addAttachedSignature.ts b/src/api/addAttachedSignature.ts index f9d2f0a..48ee4a0 100644 --- a/src/api/addAttachedSignature.ts +++ b/src/api/addAttachedSignature.ts @@ -72,6 +72,7 @@ export const addAttachedSignature = _afterPluginsLoaded( let signature: string; try { + void (__cadesAsyncToken__ + cadesSignedData.VerifyCades(messageBase64, cadesplugin.CADESCOM_PKCS7_TYPE)); signature = __cadesAsyncToken__ + cadesSignedData.CoSignCades(cadesSigner, cadesplugin.CADESCOM_PKCS7_TYPE); } catch (error) { console.error(error); diff --git a/src/api/addDetachedSignature.test.ts b/src/api/addDetachedSignature.test.ts index 25a1f57..6225f62 100644 --- a/src/api/addDetachedSignature.test.ts +++ b/src/api/addDetachedSignature.test.ts @@ -32,6 +32,7 @@ const executionFlow = { propset_ContentEncoding: jest.fn(), propset_Content: jest.fn(), SignHash: jest.fn(() => executionSteps[4]), + VerifyCades: jest.fn(), CoSignHash: jest.fn(() => executionSteps[6]), }, [executionSteps[2]]: { diff --git a/src/api/addDetachedSignature.ts b/src/api/addDetachedSignature.ts index adfa75c..abd57d6 100644 --- a/src/api/addDetachedSignature.ts +++ b/src/api/addDetachedSignature.ts @@ -74,6 +74,7 @@ export const addDetachedSignature = _afterPluginsLoaded( let signature: string; try { + void (__cadesAsyncToken__ + cadesSignedData.VerifyCades(cadesHashedData, cadesplugin.CADESCOM_PKCS7_TYPE)); signature = __cadesAsyncToken__ + cadesSignedData.CoSignHash(cadesHashedData, cadesSigner, cadesplugin.CADESCOM_PKCS7_TYPE);