M
Marco Moioli
Hi everybody:
I want to import the private key of my 1st certificate contained in my
Certification store.
I create the certificate with the private key exportable, but if I run the
code below, I obtain "Export of private parameters is not supported"
static void Main(string[] args)
{
X509CertificateStore store = X509CertificateStore.CurrentUserStore(
X509CertificateStore.MyStore );
store.OpenRead();
X509Certificate first_cert = (X509Certificate)store.Certificates[0];
RSAParameters first_cert_key = first_cert.Key.ExportParameters(true);
RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();
rsa.ImportParameters(first_cert_key);
}
Thanks in advance,
Marco
I want to import the private key of my 1st certificate contained in my
Certification store.
I create the certificate with the private key exportable, but if I run the
code below, I obtain "Export of private parameters is not supported"
static void Main(string[] args)
{
X509CertificateStore store = X509CertificateStore.CurrentUserStore(
X509CertificateStore.MyStore );
store.OpenRead();
X509Certificate first_cert = (X509Certificate)store.Certificates[0];
RSAParameters first_cert_key = first_cert.Key.ExportParameters(true);
RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();
rsa.ImportParameters(first_cert_key);
}
Thanks in advance,
Marco