EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Verify signed file CAPICOM with TElMessageVerifier

Posted: 10/23/2014 09:32:26
by marcelino araujo (Basic support level)
Joined: 10/23/2014
Posts: 3

Good Morning,

I am evaluating your product and need help.

I have an application that validates the signed files through CAPICOM.
I try to validate the signature using the TElMessageVerifier.VerifyDetached unsuccessfully.
The message that returns is: Verification failed with error # 2006

To sign files using CAPICOM:
1.Carrego the contents of the same variable in the Content of ISigner2
    cdSigner1.Content: = ...
2.Informo the certificate to be used
    cdSigner1.Certificate: = ...
3.Obtenho signing
    Signature1: = cdSignedData1.Sign (ISigner2 (cdSigner1), True, CAPICOM_ENCODE_BASE64);

After the contents of signature1 saved in a file.

To validate the signature using SBB:
1 I carry the contents of the file into memory ariginal
2 I carry the contents of the file that contains the signature for the memory
3 I call to the method signature varificar
      I: = ElMessageVerifier1.VerifyDetached (ArqOrig [0], Length (ArqOrig)ArqAss [0], Length (ArqAss));

I hope that this information is sufucientes to analize the problem
Posted: 10/24/2014 01:34:47
by Ken Ivanov (Team)

Hi Marcelino,

I see that you are passing a CAPICOM_ENCODE_BASE64 flag to the CAPICOM encoder, which forces the Sign() method to create base64-encoded signatures. As TElMessageVerifier component expects the data to be in binary (DER) format, you have to decode the signature back to binary format before passing it to VerifyDetached() method.

SecureBlackbox includes some built-in facilities for base64 processing. Please have a look at Base64Decode() method declared in SBEncoding unit.




Topic viewed 444 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!