Strong Naming Assemblies

Strong naming an assembly is a process whereby public key encryption is added to the assembly. A strong name doesn’t actually make any assurances about the trustworthiness of the assembly, but it is instead a vehicle to help to verify name uniqueness, prevent name spoofing, and provide callers with some identity when a reference is resolved.

Note

Any assembly you ship to the public should be strong named.

The process of strong naming involves generating a key pair and then using that key pair in the assembly attributes.

To create a key pair, use the sn.exe utility from the Microsoft .NET SDK with the –k switch:

sn –k newkeypair.snk

Then pass this filename to the AssemblyKeyFile attribute in the package file:

[assembly: ...

Get Delphi for .NET Developer’s Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.