仅允许数字签名的应用程序访问 wcf 服务

发布于 2024-07-25 11:17:35 字数 173 浏览 11 评论 0原文

我一直在网上搜索如何以及是否可以验证调用应用程序是否使用正确的证书进行数字签名。

这是供我公司内部使用的。 我们想要对我们的应用程序进行数字签名,并且只让我们经过数字签名的应用程序访问我们的wcf服务。 这是iis的配置还是wcf应用程序中的配置? 如何?

谢谢 马里奥斯

I have been searching n the web on how and if it is possible to verify that the calling application is digitally signed with the correct certificate.

This is for internal use for my corporation. we want to digitally sign our applications and only let our digitally signed applications to access our wcf services. is this a configuration of the iis or in the wcf app? and how?

Thanks
Marios

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

小镇女孩 2024-08-01 11:17:35

默认情况下,你不能在 WCF 中做你想做的事; 它根本不将程序集信息作为其任何安全谈判的一部分传递。

您可以通过让程序反映其程序集并使用 AssemblyName 的 PublicKeyToken 并将其作为请求的一部分传递给服务,但我不推荐这样做; 您将非常容易受到重放攻击。 任何拥有 Reflector 的人都可以随时了解如何使用您的服务。

最终,您最好在服务中构建某种凭据系统,并强制用户在使用您的服务时提供这些凭据。

You can't do what you want by default in WCF; it simply doesn't pass assembly information as part of any of its security negotiations.

You might fake it by having your program reflecting on its assembly and using the AssemblyName's PublicKeyToken and passing that up to the service as part of the request, but I don't recommend it; you'll be highly susceptible to replay attacks. Anyone with Reflector could figure out how to use your service whenever they wanted to.

Ultimately, you are better off building some sort of credentials system into your service and forcing your users to provide those credentials when using your service.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文