Archived Forum Post

Index of archived forum posts

Question:

"Incorrect hash value"?

Aug 13 '13 at 08:19

Hello,

is it possibile to store file size information in .p7s file when signing a document using CreateP7S method?

Thanks


Answer

More info: CryptVerifyMessageSignature is function that does not work with verification my signed .p7s file. It's missing output file size information.


Answer

I don't understand the problem.

1) The CreateP7S method produces a PCKS7 signature output file. It does not make sense to arbitrarily try to store additional information in an already-defined file format. PCKS7 is well defined, and one cannot simply inject new information into it unless it's part of the format..

2) CryptVerifyMessageSignature is a Microsoft Crypto API method and you should seek help regarding Crypto API methods in a more appropriate Microsoft forum. If the "size" of the PCKS7 signature is what you need, then it's simply the size of the file produced by CreateP7S. Writing code to get the size of a file should not be a challenge for any reasonably competent programmer...


Answer

After investigating more problem, it seems im getting error "Incorrect hash value". Another application is verifying my signed p7s file and it's returning that error (80091007 - Incorrect hash value). Any ideas? Thanks on fast response!


Answer

When i sign something simple (like 1234567) in my text file im getting some kind wierd chinese(?) letters in p7s file (舰옉आ蘪虈෷܁ꀂংシংʳā଱रԆหȃԚ) i know that's encoded, but it seems that's my problem? is it possible to change encoding type?