|
Posted by =?Utf-8?B?bGFtanRtZQ==?= on December 22, 2007, 1:48 pm
If you were Registered and logged in, you could reply and use other advanced thread options
I've reposted issue to platformsdk.security. Disregard post, that is unless
you absolutely, positively, know the answer! Thanks, sorry for the noise.
"lamjtme" wrote:
> I want to encrypt ciphertext with a public key and decrypt it with a private
> key. The performance impact is acceptable since I'm dealing with a very
> small payload.
>
> I have a curious problem using CryptDecrypt (w/ a public key) against a byte
> blob previously encoded with CryptEncrypt (w/ a private key). The key pair
> I'm using comes from a call to CryptAcquireCertificatePrivateKey against a
> certificate store. I can hex dump the private/public keys so I know they're
> present in the key handle. I keep getting a NTE_BAD_KEY error. I notice the
> ALG_ID on the key pair is AT_SIGNATURE. I tried force the type to CALG_KEYX
> to get it to be AT_KEYEXCHANGE but I get "invalid type error".
>
> Am I hitting an international limitation in the software or do you think i
> have a defect in my code???
|