Re: CryptVerifySignature fails with error NTE_BAD_SIGNATURE



On Aug 14, 9:08 am, lelteto <lelt...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Check the ENDIANNESS. Java should create the signature (and everything) in
big endian format, while MS CAPI expect everything in little endian format.
You may need to reverse the signature and public key bytes you got from the
server.

Laszlo Elteto
SafeNet, Inc.



"vishal.cs...@xxxxxxxxx" wrote:
Hi,

I am working on windows mobile pocketpc 5.0.
CryptVerifySignature fails with error NTE_BAD_SIGNATURE.

When i create hash, export public key , create signature and the
verify the signature it works fine.
but when server creates the signature , Client needs to verify in
mobile using CryptVerifySignature then function fails.

Both client and server using md5 hashing algorithm.

Server is using some java script to do hasing, exporting public key
and signing.
windows mobile is having the client app, which is using crypto api's.

Please someone tell me, how to solve this issue.

Thanks
Vishal- Hide quoted text -

- Show quoted text -

Hi,

I tried reversing the signature, even public key
it didn't work out.
ex: if the signature is like 107,106,36,
the reversse of this is ,63,601,701

Can you please give if any sample code which is in java to create
signing and exporting public key
and WM code to test. I have client code where it tests the signing.

Thanks
Vishal
.



Relevant Pages

  • Re: CryptMsgGetParam ( CMSG_ENCRYPTED_DIGEST) - big endian?
    ... The digital signature bytes after reversing the complete sequence obtained ... The public key is the following: ... Invoke CryptMsgOpenToDecode, CryptMsgUpdate and CryptMsgGetParam for ... Reverse the bytes of the digital signature obtained earlier. ...
    (microsoft.public.platformsdk.security)
  • Re: CryptVerifySignature fails with error NTE_BAD_SIGNATURE
    ... You just need to reverse the order of the signature bytes. ... You would need to PARSE the public key (as returned ... Unfortunately I don't have any sample code from converting Java into MS ...
    (microsoft.public.platformsdk.security)
  • RE: How can PKCS#11 sign data be verified by CSP ?
    ... In addition to convert (reverse) the signature bytes did you reverse the bytes in the public key, ... I never had problem cross-checking PKCS#11 and CAPI. ...
    (microsoft.public.platformsdk.security)
  • Re: CryptMsgGetParam ( CMSG_ENCRYPTED_DIGEST) - big endian?
    ... The digital signature bytes after reversing the complete sequence obtained ... Invoke CryptMsgOpenToDecode, CryptMsgUpdate and CryptMsgGetParam for ... Reverse the bytes of the digital signature obtained earlier. ... in implementations that expects little-endian order. ...
    (microsoft.public.platformsdk.security)
  • Re: CryptMsgGetParam ( CMSG_ENCRYPTED_DIGEST) - big endian?
    ... RSA libraries and the signature is a detached signature. ... "sjain06" wrote: ... Invoke CryptMsgOpenToDecode, CryptMsgUpdate and CryptMsgGetParam for ... Reverse the bytes of the digital signature obtained earlier. ...
    (microsoft.public.platformsdk.security)