谁应该拥有用于登录.NET程序集时,其项目是开源的私有密钥? [英] Who should own the private key used to sign a .NET assembly when its project is open-source?

查看:221
本文介绍了谁应该拥有用于登录.NET程序集时,其项目是开源的私有密钥?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更具体地,一个类库组件。我最初的想法:

More specifically, a class library assembly. My initial thoughts:

  • 有一些指定的管理员完成所有的程序集签名。但是当错误修复和新的版本写的,二进制文件将最终取决于他们被周围的(即使它只是一个小变化私人的原因)。
  • 键可以是公开的。但是,这不利于公共密钥加密技术的做法,你失去信任和认同的优势。
  • 允许终端开发商和分销商与自己的密钥签名。但你失去了模块化,因为每一个新加盟使得它与其他一些版本不兼容。

当然,你可以只是没有签署大会。但是,如果另一个项目,需要自己组装签署引用您的图书馆,你会得到一个编译错误。

Sure, you could just not sign the assembly. But if another project that requires their assembly to be signed references your library, you get a compile error.

推荐答案

我最近在一个开源项目,我保持遇到同样的问题。这里是我解决了这个问题:

I've recently encountered the same problem in an open-source project that I maintain. Here is how I addressed this issue:

  • 在源总是可以通过资源库下载中心,而是一个版本将包括源快照,再加上编译版本中。
  • 此前作出的编译版本可用,我签署组件与我的私人密钥。

所以,你的情况,谁是preparing应该拥有钥匙的释放。没有必要为库开发者知道它在所有

So in your case, whoever is preparing the release should own the key. There is no need for the library developers to know about it at all.

如果最终用户想重新编译并签署自己的钥匙,这很好。可以通过比较公钥是present在签署组件的你的二进制文件和其他人之间的区分。使公共密钥可以和其他人同样可以做到。

If end-users want to recompile and sign with their own keys, that's fine. You can distinguish between the binaries of yours and others by comparing the public key that is present in the signed assemblies. Make the public key available and others can do the same.

管理这个过程变得有点麻烦,当 InternalsVisibleToAttribute 被用来指代强名称程序集。你可以阅读我是如何解决这个问题<一href="http://stackoverflow.com/questions/1831248/what-is-the-recommended-way-to-manage-a-strong-name-key-pair-for-an-open-source-p">here.

Managing this process gets a bit cumbersome when the InternalsVisibleToAttribute is used to refer to strong-named assemblies. You can read about how I addressed that problem here.

这篇关于谁应该拥有用于登录.NET程序集时,其项目是开源的私有密钥?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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