EldoS | Feel safer!

Software components for data protection, secure storage and transfer

VerifyDetached and unsupported hash

Posted: 02/13/2007 15:08:59
by Matthew Jones (Standard support level)
Joined: 02/06/2007
Posts: 26

Using the TElRSAPublicKeyCrypto SignDetached to sign a key (as discussed in the "confused" topic) is working fine. What isn't working is verifying it. I can see that the data is all reading properly, but I'm getting an error that the hash function is unsupported.
The call stack is:

Now, I can't work out how to get the hash specified since I don't specify one anywhere, and didn't for the Signing. The hash algorithm is got from GetHashAlgorithmByOID which is passed an empty IOD. I can't see how I set that anywhere sensible. I can't see any mention of the hash in the VerifyDetached sample code either.

I'd welcome a clue as to how to get this going. The core is as per my demo, so you can see the setup of the key material there.

Thanks, Matthew. (I hope that others will find these questions useful sometime - I can't find anyone else has asked them on the search option.)
Posted: 02/13/2007 15:26:49
by Matthew Jones (Standard support level)
Joined: 02/06/2007
Posts: 26

Setting xPKEncrypt.CryptoType := rsapktPSS; stops it failing at that point and I'm getting an invalid signature result but it may be progress.
Posted: 02/13/2007 15:29:27
by Ken Ivanov (Team)

Please specify the hash algorithm via TElRSAPublicKeyCrypto.HashAlgorithm property. You should use the same values for both encrypting and decrypting routine (e.g., SB_ALGORITHM_DGST_SHA1).
Posted: 02/13/2007 15:43:01
by Matthew Jones (Standard support level)
Joined: 02/06/2007
Posts: 26

Okay, giving the validation the right stream to compare against helps too. And once I've done that, the CryptoType setting is no longer needed.

You know - it is all actually working how I want it!

I think I'll call it a day now, but I must say a big thank you for the support. I'll tidy this demo too, and maybe someone will care enough for it.

Many thanks all.




Topic viewed 2824 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!