【问题标题】:PKCS#11 HSM Remember PasswordPKCS#11 HSM 记住密码
【发布时间】: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


    【解决方案1】:

    您的问题不清楚。哪个窗口?如果你需要记住一个变量,你可以在命令行中设置一个变量 whit
    字符串 pin = sc.nextLine(); 准备好了!!

    【讨论】:

    • 使用评论来请求有关问题而不是答案的更多详细信息。
    • 问题是你在上面看到的这个窗口来自SignedCms,我不能为此修改windows程序
    【解决方案2】:

    每次我调用函数来签名它都会显示这个屏幕我想记住密码,在某些程序中我注意到它只询问一次

    【讨论】:

    • 那究竟是如何回答这个问题的?
    猜你喜欢
    • 1970-01-01
    • 2018-06-29
    • 1970-01-01
    • 1970-01-01
    • 2014-03-13
    • 2011-03-14
    • 2010-11-01
    • 2012-08-15
    • 1970-01-01
    相关资源
    最近更新 更多