RE: Decryption using private key from cert store failing with err
From: Rhett Gong [MSFT] (v-raygon_at_online.microsoft.com)
Date: 02/16/05
- Previous message: scott: "RE: Decryption using private key from cert store failing with err"
- In reply to: scott: "RE: Decryption using private key from cert store failing with err"
- Next in thread: Rhett Gong [MSFT]: "RE: Decryption using private key from cert store failing with err"
- Reply: Rhett Gong [MSFT]: "RE: Decryption using private key from cert store failing with err"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Wed, 16 Feb 2005 03:14:53 GMT
>I tried changing my datasize to 117 and still get the bad data return. I
>also do not know why you recommended adding the cryptencrypt call.
>I am trying to implement part of the SSL protocol, and it requires that I
And if you have encrypted string as the input for your code, then calling
CryptDecrypt with proper key or hash value should work as expected.
However, from your first post. what I got was that you were trying to
decrypt a plain string which has 128 'A's. Though the buf is just a stream
of bits and meanless, but if you want want to decrypted with alg&key you
define, they must be valid for the decrypt process, otherwise, CryptDecrypt
will fail and you may get NTE_BAD_DATA as last error.
Since your code looks like a test sample, that is why I suggest you add
encrypt code to see how it works.
PS, the code works fine in my side, have you changed MY_DATASIZE 0as
follows?
enum
{
MY_BUFSIZE=(32*1024)
,MY_DATASIZE=(117)
};
Thanks and Regards,
Rhett Gong [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties and confers no rights.
- Previous message: scott: "RE: Decryption using private key from cert store failing with err"
- In reply to: scott: "RE: Decryption using private key from cert store failing with err"
- Next in thread: Rhett Gong [MSFT]: "RE: Decryption using private key from cert store failing with err"
- Reply: Rhett Gong [MSFT]: "RE: Decryption using private key from cert store failing with err"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|