Can Anyone Help me
I am trying to decrypt using an X509 certificate private key. I am using the following
function:
Shared Function DecryptwithCertificate(ByVal code As Array) As Byte()
Dim envelopedCms As EnvelopedCms = New EnvelopedCms()
envelopedCms.Decode(code)
envelopedCms.Decrypt()
Return envelopedCms.ContentInfo.Content
End Function
The system is throwing the following exception:
System.Security.Cryptography.CryptographicException: incorrect key
at the line:
envelopedCms.Decrypt()< ...
Go to the complete details ...