WSE中如何配置使用证书签名验证和加密

chuxiyue 2006-05-27 04:03:06
WSE2.0给出的证书范例;
操作系统 winxp
Web服务端
在 本地计算机 和个人用户中的个人目录下都添加了.pfx文件,使用WSE自带的X509 Certificate tool验证也没有问题。web.config中也添加了 <x509 storeLocation="LocalMachine" />
客户端
引入.cer文件,进行验证,始终不能通过;

有没有哪里疏忽了?
...全文
441 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
int64 2006-09-05
  • 打赏
  • 举报
回复
楼上的,要using什么东西啊?
levinknight 2006-05-28
  • 打赏
  • 举报
回复
贴你的代码出来,WSE3.0早出来了,为什么不用?
chuxiyue 2006-05-28
  • 打赏
  • 举报
回复
服务器端不用添加什么代码吧。设置<x509 storeLocation="LocalMachine" />在Web.config里,然后在证书库中导入证书。
客户端
其中CertPath为.cer文件的地址。
x509 = X509Certificate.CreateCertFromFile(CertPath);
X509SecurityToken certtoken = new X509SecurityToken(x509);
UNTAuthenticationWse untauthenticationwse = new UNTAuthenticationWse();
untauthenticationwse.RequestSoapContext.Security.Tokens.Add(certtoken);
untauthenticationwse.RequestSoapContext.Security.Elements.Add(new MessageSignature(certtoken));
untauthenticationwse.GetString();

12,162

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 Web Services
社区管理员
  • Web Services社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧