public void VerifyMSISignatureAuthentic() { string destPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), AuthenticFilename); DownloadFromAzureStorage(AuthenticFilename, destPath); bool result = FileSignatureVerifier.IsSignatureValid(destPath); Verify.IsTrue(result, "MSI Signature verification passed."); }
public void VerifyMSISignatureBuggy() { string destPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), BuggyFilename); DownloadFromAzureStorage(BuggyFilename, destPath); bool result = false; try { result = FileSignatureVerifier.IsSignatureValid(destPath); } catch (Exception) { Verify.IsFalse(result, "MSI Signature verification failed as expected."); } }
private static bool CheckIsCabFile(string cabPath) { SFDeployerTrace.WriteNoise(StringResources.Info_BPAValidatingCab, cabPath); bool result = CabFileOperations.IsCabFile(cabPath); if (!result) { SFDeployerTrace.WriteError(StringResources.Error_SFCabInvalid, cabPath); return(result); } result = FileSignatureVerifier.IsSignatureValid(cabPath); if (!result) { SFDeployerTrace.WriteError(StringResources.Error_InvalidCodePackage); } // Add Signature Validation. return(result); }