我是否需要保护开源项目的强名称密钥文件?

发布于 2024-07-19 08:29:42 字数 137 浏览 2 评论 0 原文

我正在创建一个入门工具包,将开源项目中已编译的程序集安装到 GAC 中,以便更轻松地引用模板中的程序集。 由于它们要加入 GAC,因此需要进行签名。

我是否需要使用密码保护密钥文件,或者可以将其保持打开状态并将文件包含在源代码管理中吗?

I'm creating a starter kit that installs the compiled assemblies from an open-source project into the GAC to make it easier to reference the assemblies in the template. Since they're going in the GAC, they need to be signed.

Do I need to password protect and secure the key file, or is it okay to leave it open and include the file in source control?

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

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

发布评论

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

评论(2

晨光如昨 2024-07-26 08:29:42

强名称签名有几个目的(尽管不是用于实际防止程序被篡改,这是常见的误解) - 在您的情况下,使用强密钥来唯一标识(和验证)特定版本GAC 要求的特定程序集。 另一种用法是防止其他程序集的欺骗,在这种情况下似乎没有必要(如果我错了,请纠正我)。 因此,我认为将密钥保持打开状态(不受密码保护)并将文件包含在源代码管理中是完全可以接受的。 据我所知,你不会通过密码保护密钥来阻止任何你不想要的事情。 (但是,如果您可以提供有关安全上下文的更多详细信息,我可能必须修改该视图。)

另外,请参阅 这篇 MSDN 文章 对如何正确使用强名称签名进行了深入的讨论。

Strong name signing has several purposes (though not for actual protection against tampering with the program, as is common misconception) - in your case the usage of a strong key for uniquely identifying (and verifying) a specific version of a specific assembly, which is required by the GAC. The other usage, which is preventing spoofing by other assemblies, doesn't seem necessary in this case (correct me if I'm wrong). For this reason, I would believe that it's perfectly acceptable to leave the key open (not password protected) and include the file in source control. As far as I can see, you're not going to stop anything you don't want by password protecting the key. (However, if you could provide more detail on the security context, I might have to revise that view.)

Also, see this MSDN article for a great thorough discussion of how to properly use strong name signing in general.

过潦 2024-07-26 08:29:42

我想说的是,在源代码控制中包含一个“开发”密钥,以使构建更容易,并避免强迫人们浪费时间创建和使用自己的密钥。 源代码控制中的密钥在安全方面毫无意义,因为任何人都可以用它签名。 如果人们想要签署他们的开源项目构建,他们可以替换他们的密钥,他们可以按照自己喜欢的方式管理该密钥。

您还可以提供可供下载的版本,并使用安全密钥进行签名(您不会向任何人提供该密钥),但是对于想要使用这些二进制文件的人来说,他们需要信任您。 你值得信赖吗? :)

I would say include a 'development' key in source control, to make building easier and avoid forcing people to faff around with creating and using their own key. The key in source control is meaningless security-wise, since anyone can sign with it. If people want to sign their build of your open-source project, they can substitute their key which they can manage any way they like.

You could also provide builds for download, signed with a secured key (that you don't give anyone), but for people to want to use these binaries they would need to trust you. Are you trustworthy? :)

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