Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Identify Delay signed assembly

I have lot of assemblies inside one folder. Only some of them are marked for delay signing.

Now, I have to sign all those assemblies who have marked for delay signing.

How to identity which assembly is marked for delay signing and which is not?

like image 491
Ashok kumar Avatar asked Feb 05 '14 09:02

Ashok kumar


People also ask

How do you check if assembly is delay signed?

You can run sn -v "path to your assembly" . This will output xxx is a delay-signed or test-signed assembly if the assembly is delay signed. sn -v doesn't show me xxx is a delay-signed or test-signed assembly .

How do I find my assembly signature?

To detect whether the assembly file is signed or not, right click on the file and click the 'Properties' from the context menu. If you see a 'Digital Signatures' tab in the properties window, that means, the file is signed by a digital signature (as shown below).

What is the need of delay signing the assemblies?

Delayed signing refers to a technique of partially signing assemblies while they are in the development phase. So, signing an assembly basically certifies that assembly by the manufacturer and prevents tampering and hi-jacking of that assembly.

What is DLL signing?

Signed dll are strongly named. A strong name consists of the assembly's identity—its simple text name, version number, and culture information (if provided)—plus a public key and a digital signature.


2 Answers

You need to use sn -vf

Verify for strong name signature self consistency. If -vf is specified, force verification even if disabled in the registry.

like image 181
George Trifonov Avatar answered Oct 17 '22 12:10

George Trifonov


You can run sn -v "path to your assembly". This will output xxx is a delay-signed or test-signed assembly if the assembly is delay signed.

If you prefer to do it in .NET, you may want to use StrongNameSignatureVerificationEx to check the signature (http://blogs.msdn.com/b/shawnfa/archive/2004/06/07/150378.aspx)

[DllImport("mscoree.dll", CharSet = CharSet.Unicode)]
static extern bool StrongNameSignatureVerificationEx(string wszFilePath, bool fForceVerification, ref bool pfWasVerified);
like image 6
meziantou Avatar answered Oct 17 '22 12:10

meziantou