L
lamjtme
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???
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???