File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 33using System . IO ;
44using System . Linq ;
55using System . Reflection ;
6+ using System . Security . Cryptography . X509Certificates ;
67using System . Text ;
78using System . Threading . Tasks ;
89
@@ -37,7 +38,17 @@ public static bool CheckAssemblyForValidCertificate(string assemblyPath)
3738 }
3839
3940 //Verify the node library has a verified signed certificate
40- var cert = asm . Modules . FirstOrDefault ( ) ? . GetSignerCertificate ( ) ;
41+ X509Certificate cert ;
42+ try
43+ {
44+ cert = X509Certificate . CreateFromSignedFile ( assemblyPath ) ;
45+ }
46+ catch
47+ {
48+ throw new Exception ( String . Format (
49+ "A dll file found at {0} did not have a certificate attached." , assemblyPath ) ) ;
50+ }
51+
4152 if ( cert != null )
4253 {
4354 var cert2 = new System . Security . Cryptography . X509Certificates . X509Certificate2 ( cert ) ;
You can’t perform that action at this time.
0 commit comments