0

I am using the following API to verify if a file is signed CoSign Signature Local > Signature Local COM Methods for Signing and Verifying > SAPICryptCOM Functions > FileIsSignedEx

Example:

SAPI.FileIsSignedEx(
          hSession,
          SAPI_ENUM_FILE_TYPE.SAPI_ENUM_FILE_OFFICE_XML_PACKAGE,
          fileName,
          null,
          0,
          ref isSigned
      );

`

This works if the file has a newer signature field. The name of the field in the *.docx file is something like {388F8850-55AF-4729-BE27-F1E5FCAC5A8F}

However if the .docx file contains an older signature field then the function always returns 0(false) even if the file is signed. The name of the older signature field is ArGrDigsig2

The related functions like SignatureFieldInfoGet also return nothing for the older field even if it is signed today.

Any idea what is happening here?

Old field and new field

Simon Mourier
  • 132,049
  • 21
  • 248
  • 298

1 Answers1

1

Older signature field named "ArGrDigsign" are ARX CoSign Legacy signature fields. These signatures are proprietary signatures of ARX CoSign for office documents. These signatures are implemented with MS macros and can be used only from MS Office applications. Only the new standard Office or DocuSign signature lines signatures can be used also via DSA APIs like SAPI Local.

  • Thanks for the clarification. I verified by converting the .docx file to word .doc file and changing the type to `SAPILib.SAPI_ENUM_FILE_WORD` instead of `SAPILib.SAPI_ENUM_FILE_OFFICE_XML_PACKAGE`. Sure enough the signature information is retrieved. I am exploring a solution where I can convert the document to the old type on the fly. Maybe if I could convert only the signature field by extracting it to a buffer then it may be a bit faster. – Ravikumar Subbaroyan Dec 29 '17 at 11:28