Posted on: 3/16/2011 10:33:06 AM | Views : 305

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 ...