什么是.SNK呢? [英] What is a .snk for?

查看:176
本文介绍了什么是.SNK呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是.snk文件呢?我知道它代表的强命名关键,但它是什么以及它如何工作去了我的头。所有的解释

What is a .snk file for? I know it stands for Strongly Named Key, but all explanations of what it is and how it works goes over my head.

有没有关于如何强命名的密钥用于任何简单的解释,它是如何工作的?

Is there any simple explanation on how a strongly named key is used and how it works?

推荐答案

.snk文件用于应用的强名称为.NET程序集。如此强劲的名称由

The .snk file is used to apply a strong name to a .NET assembly. such a strong name consists of

一个简单的文本名称,版本号,   和区域性信息(如果   提供)-PLUS一个公开密钥和一个   数字签名。

a simple text name, version number, and culture information (if provided)—plus a public key and a digital signature.

在SNK包含一个独特的密钥对 - 可以用于确保您有装配了独特的强有力的名称的私钥和公钥。当组件强烈命名,散列是从组件的内容构成,散列进行加密的私钥。然后这个签名散列被放置在组件一起从.SNK公钥。

The SNK contains a unique key pair - a private and public key that can be used to ensure that you have a unique strong name for the assembly. When the assembly is strongly-named, a "hash" is constructed from the contents of the assembly, and the hash is encrypted with the private key. Then this signed hash is placed in the assembly along with the public key from the .snk.

后来,当有人需要验证强名称程序集的完整性,的他们的建设大会的内容的哈希值,并使用公共密钥从装配附带的哈希进行解密与装配 - 如果两个散列匹配,装配验证通过

Later on, when someone needs to verify the integrity of the strongly-named assembly, they build a hash of the assembly's contents, and use the public key from the assembly to decrypt the hash that came with the assembly - if the two hashes match, the assembly verification passes.

要能够用这种方式来验证组件,以确保没有人交换了装配恶意一个将颠覆整个应用程序是很重要的。这就是为什么非强命名组件中相同的方式,强名称组件是不信任的,因此它们不能被放置在GAC。此外,还有一个信任链 - 你不能生成引用非强名称的程序集强命名程序集

It's important to be able to verify assemblies in this way to ensure that nobody swaps out an assembly for a malicious one that will subvert the whole application. This is why non-strong-named assemblies aren't trusted in the same way that strongly-named assemblies are, so they can't be placed in the GAC. Also, there's a chain of trust - you can't generate a strongly-named assembly that references non-strongly-named assemblies.

文章强命名的秘密。是否详细解释这些概念了出色的工作。随着图片。

The article "The Secrets of Strong Naming". Does an excellent job of explaining these concepts in more detail. With pictures.

这篇关于什么是.SNK呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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