Re: Sign with RsaCryptoService Provider Verify with win32 Crypto A
- From: "Mitch Gallant" <jensigner@xxxxxxxxxxxxxxxx>
- Date: Sun, 15 Jul 2007 18:28:17 -0400
also CryptSignHash (and VerifySignature) generate and take a pkcs1 signature
in little-endian order. .NET creates (and expects) the reverse byte sequence
(big-endian order).
If you are using some of the MSDN documentation for capi, and are signing
string content, are you also signing the terminal null character for the
string?
- Mitch Gallant
"lelteto" <lelteto@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:4F3ACE03-BFEF-4B3E-8D11-4F37AE5E86C8@xxxxxxxxxxxxxxxx
1. Do you use the same hash algo? (eg. SHA-1)
2. What flags are you using in CryptSignHash and CryptVerifySignature (in
your C++ code)? do you set CRYPT_NOHASHOID?
3. Is you data binary? text string? Do you specify the exact LENGTH for
both
C++ and C#?
Laszlo Elteto
SafeNet, Inc.
"Leslie" wrote:
Great. The problem I have encountered is as follows.
I setup a test program in C++ which signs some data using CryptSignHash
and
then verifies the signature of the data using CryptVerifySignature. All
of
this is done using the Win32 Crypto API and works just fine.
Next, I attempt to sign the same data using the RsaCryptoServiceProvider.
The call to RSACryptoServiceProvider.SignData returns the signature byte
array but the bytes returned do not match the signature bytes returned
from
the call to CryptSignHash in the crypto API. As a result, the call to
CryptVerifySignature using the bytes from
RSACryptoServiceProvider.SignData
fails.
Is there something I should be doing differently?
Thanks,
Leslie
Do
"Dominick Baier" wrote:
RSACryptoServiceProvider is just a thin wrapper arounf the native
Crypto
API. so yes.
-----
Dominick Baier (http://www.leastprivilege.com)
Developing More Secure Microsoft ASP.NET 2.0 Applications
(http://www.microsoft.com/mspress/books/9989.asp)
I have a web application written in C# that needs to Sign some data
with private key that can be verified on a c++ client using win32
crypto api. Can this be done?
I would like to avoid using mixed mode on either platform if
possible.
Thanks,
Leslie
.
- Follow-Ups:
- References:
- Re: Sign with RsaCryptoService Provider Verify with win32 Crypto API
- From: Dominick Baier
- Re: Sign with RsaCryptoService Provider Verify with win32 Crypto API
- Prev by Date: Re: Sign with RsaCryptoService Provider Verify with win32 Crypto A
- Next by Date: Re: application permissions
- Previous by thread: Re: Sign with RsaCryptoService Provider Verify with win32 Crypto A
- Next by thread: Re: Sign with RsaCryptoService Provider Verify with win32 Crypto A
- Index(es):
Relevant Pages
|