예제 #1
0
        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.");
        }
예제 #2
0
        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.");
            }
        }
예제 #3
0
        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);
        }