问题描述
我正在将智能卡证书从用户存储中发送到CmsSigner的构造函数中,并且出现一条错误消息,指出将上下文作为静默获取.有什么想法吗?
I'm sending the smart card certificate from the user store into the constructor for CmsSigner and i get an error saying context was acquired as silent. Any ideas??
我正在尝试使用智能卡对PKCS加密进行签名.
I'm trying to sign PKCS encryption using a smart card.
ContentInfo contentInfo = 新 ContentInfo (msg);
ContentInfo contentInfo = newContentInfo(msg);
CmsSigner cmsSigner = 新 CmsSigner (signerCert);
CmsSigner cmsSigner = newCmsSigner(signerCert);
cmsSigner.IncludeOption =
cmsSigner.IncludeOption =
X509IncludeOption .EndCertOnly;
X509IncludeOption.EndCertOnly;
signedCms.ComputeSignature(cmsSigner);
signedCms.ComputeSignature(cmsSigner);
推荐答案
您可以发布异常详细信息吗?您的代码段中的哪一行引发了异常?
Could you post the exception detail? Which line in your code snippet throws the exception?
但是,如果错误是"0x80090022:提供者无法执行操作,因为上下文被获取为静默" ,您可能需要阅读以下内容博客,其中讨论了一些修复程序,希望对您有所帮助.
However, if the error is"0x80090022: Provider could not perform the action since the context was acquired as silent", you may want to read thisblog which discussed some fixes, hope this helps.
这篇关于将SignedCms与智能卡证书一起使用时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!