public void Unsign_Works() { using (var signingTool = new PortableExectuableSigningTool()) { Assert.IsTrue(signingTool.IsFileSigned("Unsign_Works/signed/signed.dll")); signingTool.UnsignFile("Unsign_Works/signed/signed.dll"); Assert.IsFalse(signingTool.IsFileSigned("Unsign_Works/signed/signed.dll")); } }
public void Unsign_Works() { using (var signingTool = new PortableExectuableSigningTool(Log)) { string file = Path.Combine(ExecutionDirectory, "Unsign_Works/signed/signed.dll"); Assert.IsTrue(signingTool.IsFileSigned(file)); signingTool.UnsignFile(file); Assert.IsFalse(signingTool.IsFileSigned(file)); } }
public void IsFileSigned_SignedFile_UntrustedCertificate_ReturnsTrue() { using (var signingTool = new PortableExectuableSigningTool()) { Assert.IsTrue(File.Exists("TestFiles/signed/signed.dll")); Assert.IsTrue(signingTool.IsFileSigned("TestFiles/signed/signed.dll")); } }
public void IsFileSigned_SignedFile_UntrustedCertificate_ReturnsTrue() { using (var signingTool = new PortableExectuableSigningTool(Log)) { Assert.IsTrue(File.Exists(Path.Combine(ExecutionDirectory, "TestFiles/signed/signed.dll"))); Assert.IsTrue(signingTool.IsFileSigned(Path.Combine(ExecutionDirectory, "TestFiles/signed/signed.dll"))); } }
public void IsFileSigned_SignedFile_TrustedCertificate_ReturnsTrue() { using ( new CertificateStoreHelper("Certificates/SigningServer.Test.pfx", StoreName.Root, StoreLocation.LocalMachine)) { using (var signingTool = new PortableExectuableSigningTool()) { Assert.IsTrue(File.Exists("TestFiles/signed/signed.dll")); Assert.IsTrue(signingTool.IsFileSigned("TestFiles/signed/signed.dll")); } } }
public void IsFileSigned_SignedFile_TrustedCertificate_ReturnsTrue() { using ( new CertificateStoreHelper(CertificatePath, StoreName.Root, StoreLocation.LocalMachine)) { using (var signingTool = new PortableExectuableSigningTool(Log)) { Assert.IsTrue(File.Exists(Path.Combine(ExecutionDirectory, "TestFiles/signed/signed.dll"))); Assert.IsTrue(signingTool.IsFileSigned(Path.Combine(ExecutionDirectory, "TestFiles/signed/signed.dll"))); } } }