What is a .snk for?

前端 未结 5 1137
我寻月下人不归
我寻月下人不归 2020-12-02 04:26

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 a

5条回答
  •  死守一世寂寞
    2020-12-02 04:48

    The .snk file is used for signing the assemblies in order to be able to add them to the Global Assembly Cache (GAC).

    The .snk file contains the public and private tokens for your key. When you want to sign some data (or binary) with that key, a checksum is calculated on the data, which is then encrypted with the private token. The encrypted checksum is then added to the data. Anyone can use the public token from your key to decrypt the checksum and compare it to the checksum they calculated to verify that the signed data hasn't been tampered.

    You can read more about the public key cryptography at http://en.wikipedia.org/wiki/Public-key_cryptography.

提交回复
热议问题