我使用带有X509Certificate的.cer文件对pdf进行数字签名。但是在IExternalSignature上,我没有签名。错误出现“没有私钥”
这是我的代码
string uc= Server.MapPath("~/username.cer");
System.Security.Cryptography.X509Certificates.X509Certificate cert = new System.Security.Cryptography.X509Certificates.X509Certificate();
cert.Import(uc);
X509Certificate2 signatureCert = new X509Certificate2(cert);
IExternalSignature externalSignature = new X509Certificate2Signature(signatureCert, "SHA-1");
在最后一行,我收到错误消息“无私钥”
建议我解决方案