Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

signing assemblies with a strong name, ok, but what if some 3rd party DLL isn't signed?

I understand the basic idea behind signing assemblies but have a problem when using Telerik or 2rd party DLLs. I have an .exe that uses 2 of my own .DLLs, the DLLs in turn make use of the Enterprise library DLLs and Telerik DLLs.

I gave all my projects a strong name .snk, but when compiling the compiler explains that the enterprise library DLLs, for example, aren't signed, which makes sense.

I don't want to turn off the verification with te sn.exe -Vr command or even delay sign my projects. But then how is this going to work? I'm grateful for any insight.

like image 574
John Avatar asked Nov 22 '10 11:11

John


People also ask

What is a third party DLL?

Third party DLLs are libraries created by other organisation outside of yours. You can use these third party DLLs by putting them into a folder in your solution and then creating a reference to it (Project-> Right Click-> Add Reference). Once you have the DLL, that DLL will have a namespace.

How do you check if a DLL is strong-named?

To determine if an assembly is strong-typed, use the Strong Name Tool from Microsoft (http://msdn.microsoft.com/en-us/library/k5b5tt23(v=vs.71).aspx) by running the 'sn.exe -v <assembly>' command. You may need to download one of the Windows SDK packages to get access to this tool.

What does signing a DLL mean?

A digital signature is used to help authenticate the identity of the creator of digital information — such as documents, e-mail messages etc. — by using the cryptographic algorithms. When a . dll and/or .exe file is digitally signed by a signer, you can confirm the same from the said file's properties.


1 Answers

It's inconvenient, but not rocket science to sign/resign third party assemblies. Assuming you want to sign an unsigned dll like System.ComponentModel.Composition.dll with the default.snk key:

open the VS command prompt and cd to your folder with the unsigned dll(s)

ildasm /all /out=System.ComponentModel.Composition.il System.ComponentModel.Composition.dll
ilasm /dll /key=default.snk System.ComponentModel.Composition.il
del System.ComponentModel.Composition.il

In each applicable VS project, remove and add back the reference to your signed assembly System.ComponentModel.Composition.dll

like image 100
dmihailescu Avatar answered Oct 10 '22 18:10

dmihailescu