【发布时间】:2021-10-14 18:51:17
【问题描述】:
我需要在窗口第一次询问 HSM PIN 后,它会被记住以供下次调用
cert = Cert.GetCertificateFromStore();
RSA rsa = RSA.Create();
rsa = (RSA)cert.PrivateKey;
byte[] text = System.Text.Encoding.ASCII.GetBytes("Assinged"); ;
ContentInfo content = new ContentInfo(text);
SignedCms signedCms = new SignedCms(content, false);
CmsSigner signer = new CmsSigner(SubjectIdentifierType.IssuerAndSerialNumber, cert);
signer.DigestAlgorithm = new Oid(CryptoConfig.MapNameToOID("SHA256"));
signer.SignedAttributes.Add(new Pkcs9SigningTime());
// create the signature
signedCms.ComputeSignature(signer);
【问题讨论】:
标签: c# x509certificate