by Sarah Boaz [sarahb at loansoft dot com] posted on 2004/08/26 |
|
In attempting to encrypt with a private key, I created a Org.Mentalis.Security.Certificate object "cert" and used it's private key to instantiate a OAEPKeyExchangeFormatter:
Dim RSAFormatter As New RSAOAEPKeyExchangeFormatter(cert.PrivateKey)
encryptedData = RSAFormatter.CreateKeyExchange(decryptedData)
But, when I do this, I can only decrypt it with the PRIVATE key, which makes me think it's actually using the public key to encrypt. I can't access the key directly since it itself is encrypted in a PFX file so I have limited ways to test if it's really using the private key.
Does passing the private key to a RSAOAEPKeyExchangeFormatter guarantee it's using the private key?
Thanks again.
|