Need Help with CryptoAPI DSA Signature Verification Options
- From: Shailesh <vshailesh@xxxxxxxxx>
- Date: Thu, 09 Aug 2007 12:56:11 -0700
I have problems verifying a signature signed using DSA with the
MS_DEF_DSS_PROV provider.
I believe I am not setting up the private key correctly, and would
like some help.
I have known P,Q,G,X & Y keys that have been working using a 3rd party
library.
What works: Using CryptoAPI, I have Acquired a default container
context
with CRYPT_VERIFYCONTEXT | CRYPT_SILENT flags,
created a PUBLICKEYBLOB (v3), called CryptImportKey
and can succesully call CryptVerifySignature on a buffer
hash
passing it a RS buffer (created from the 3rd party
library).
What does not work:
a) In a new empty "named" container that I Acquired
( with CRYPT_NEWKEYSET | CRYPT_MACHINE_KEYSET | CRYPT_SILENT )
I set up a PRIVATEKEYBLOB (v3) and attempt to call
CryptImportKey,
which fails.
So I changed it to create a v2 PRIVATEKEYBLOB,
which CryptImportKey seems to be accept (returns TRUE)
(but interestingly GetLastError shows 0x000003f0 -
An attempt was made to reference a token that does not exist)
Then a call to CryptGetUserKey succeeds.
b) Using this key, (which I am under the impression is the private
key),
I call CryptGetKeyParam( KP_VERIFY_PARAMS ) and it returns
false.
This tells me (what I believe is) my private key may not have
been
created correctly.
( I also created a v3 PUBLICKEYBLOB and created the public key
in this container, but with or without it - the problems
remain.)
c) if I ignore this, and continue onto creating a SHA1 hash and
signing it,
the call to CryptVerifySignature fails.
In summary, if I call CryptVerifySignature with the public key,
on a buffer signed by the 3rd party library, the call succeeds.
But if I sign a buffer with CryptoAPI and call
CryptVerifySignature,
the call fails.
What else do I need to do to get this to work?
--Shailesh
.
- Prev by Date: Re: Questions about smart card minidriver
- Next by Date: Re: Questions about smart card minidriver
- Previous by thread: Questions about smart card minidriver
- Next by thread: RE: Need Help with CryptoAPI DSA Signature Verification Options
- Index(es):
Relevant Pages
|