Exemple #1
0
 public void Unsign_Works()
 {
     var signingTool = new PowerShellSigningTool();
     {
         Assert.IsTrue(signingTool.IsFileSigned("Unsign_Works/signed/signed.ps1"));
         signingTool.UnsignFile("Unsign_Works/signed/signed.ps1");
         Assert.IsFalse(signingTool.IsFileSigned("Unsign_Works/signed/signed.ps1"));
     }
 }
Exemple #2
0
        public void IsFileSigned_SignedFile_UntrustedCertificate_ReturnsTrue()
        {
            var signingTool = new PowerShellSigningTool();

            Assert.IsTrue(File.Exists("TestFiles/signed/signed.ps1"));
            Assert.IsTrue(signingTool.IsFileSigned("TestFiles/signed/signed.ps1"));
        }
Exemple #3
0
 public void IsFileSigned_SignedFile_TrustedCertificate_ReturnsTrue()
 {
     using (
         new CertificateStoreHelper("Certificates/SigningServer.Test.pfx", CertificatePassword, StoreName.Root,
                                    StoreLocation.LocalMachine))
     {
         var signingTool = new PowerShellSigningTool();
         {
             Assert.IsTrue(File.Exists("TestFiles/signed/signed.ps1"));
             Assert.IsTrue(signingTool.IsFileSigned("TestFiles/signed/signed.ps1"));
         }
     }
 }