I want to import a certificate in Silverlight.
If I do this:
X509Certificate cert = new X509Certificate(data, "pwd");
Being data a byte[] get from a OpenFileDialog, I get this error: CryptographicException "Cannot find the requested
object."
Stack Trace:
at System.Security.Cryptography.CryptographicException.ThrowCryptographicException(Int32 hr)
at System.Security.Cryptography.X509Certificates.X509Utils._QueryCertBlobType(Byte[] rawData)
at System.Security.Cryptography.X509Certificates.X509Certificate.LoadCertificateFromBlob(Byte[] rawData, Object password, X509KeyStorageFlags keyStorageFlags)
at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(Byte[] rawData, String password)
The exact same code works in Windows forms.
Any idea of what the problem might be? Regards.