将SignedCms与智能卡证书一起使用时出错 [英] Error when using signedCms with smartcard certificate

查看:92
本文介绍了将SignedCms与智能卡证书一起使用时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将智能卡证书从用户存储中发送到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 = new ContentInfo(msg);

 

 

 

 

 

 

 

 

CmsSigner cmsSigner = CmsSigner (signerCert);

CmsSigner cmsSigner = new CmsSigner(signerCert);

 

cmsSigner.IncludeOption =

cmsSigner.IncludeOption =

 

X509IncludeOption .EndCertOnly;

X509IncludeOption.EndCertOnly;

 

 

signedCms.ComputeSignature(cmsSigner);

signedCms.ComputeSignature(cmsSigner);

推荐答案

 

 

Hi,

 

您可以发布异常详细信息吗?您的代码段中的哪一行引发了异常?

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 this blog which discussed some fixes, hope this helps.


这篇关于将SignedCms与智能卡证书一起使用时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆