Need Help with CryptoAPI DSA Signature Verification Options



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

.



Relevant Pages

  • Re: mail mit VB abrufen
    ... Private Enum ePOP3State ... Private buffer As String ... If Err.Number = 0 Then ... Select Case state 'incoming state, ...
    (microsoft.public.de.vb)
  • Re: Can someone help me
    ... // contents from the server to the client public class AsynchNetworkFileServer {class ClientHandler {// constructor public ClientHandler(Socket socketForClient) {// initialize member variable socket = socketForClient; // initialize buffer to hold ... // contents of file buffer = new byte; // create the network stream networkStream = new NetworkStream; // set the file callback for reading ...
    (microsoft.public.dotnet.languages.csharp)
  • DirectSound - record audio problem: static recorded....
    ... Could it be related to a block alignment - I set the size of my buffer ... Private bwWav As BinaryWriter = Nothing ... Private Sub btnRecord_ClickHandles btnRecord.Click ... A wave file is a RIFF ...
    (microsoft.public.win32.programmer.directx.audio)
  • DX8 SetNotificationPositions, Error 32811
    ... Private SEnum As DxVBLibA.DirectSoundEnum8 ... ' buffer, and buffer description ... Private Buff As DxVBLibA.DirectSoundCaptureBuffer8 ... Private Sub DirectXEvent8_DXCallback ...
    (microsoft.public.dotnet.languages.vb)
  • DX8 SetNotificationPositions, Error 32811
    ... Private SEnum As DxVBLibA.DirectSoundEnum8 ... ' buffer, and buffer description ... Private Buff As DxVBLibA.DirectSoundCaptureBuffer8 ... Private Sub DirectXEvent8_DXCallback ...
    (microsoft.public.dotnet.general)