Exemplo n.º 1
0
 internal BatchSignUtil(IBuildEngine buildEngine, TaskLoggingHelper log, SignTool signTool, BatchSignInput batchData, string orchestrationManifestPath)
 {
     _signTool  = signTool;
     _batchData = batchData;
     _orchestrationManifestPath = orchestrationManifestPath;
     _log         = log;
     _buildEngine = buildEngine;
 }
Exemplo n.º 2
0
 internal BatchSignUtil(IBuildEngine buildEngine, TaskLoggingHelper log, SignTool signTool,
                        BatchSignInput batchData, string[] itemsToSkipStrongNameCheck)
 {
     _signTool    = signTool;
     _batchData   = batchData;
     _log         = log;
     _buildEngine = buildEngine;
     _itemsToSkipStrongNameCheck = itemsToSkipStrongNameCheck ?? Array.Empty <string>();
 }
Exemplo n.º 3
0
        internal BatchSignUtil(IBuildEngine buildEngine, TaskLoggingHelper log, SignTool signTool, BatchSignInput batchData, string orchestrationManifestPath)
        {
            _signTool  = signTool;
            _batchData = batchData;
            _orchestrationManifestPath = orchestrationManifestPath;
            _log         = log;
            _buildEngine = buildEngine;

            // TODO: Better path; for now making sure the relative paths are all in the same "OutputDirectory" value should help things work.
            _unpackingDirectory = Path.Combine(batchData.OutputPath, "ZipArchiveUnpackingDirectory");
        }
Exemplo n.º 4
0
 internal BatchSignUtil(IBuildEngine buildEngine,
                        TaskLoggingHelper log,
                        SignTool signTool,
                        BatchSignInput batchData,
                        string[] itemsToSkipStrongNameCheck,
                        Dictionary <SignedFileContentKey, string> hashToCollisionIdMap,
                        Telemetry telemetry = null)
 {
     _signTool    = signTool;
     _batchData   = batchData;
     _log         = log;
     _buildEngine = buildEngine;
     _itemsToSkipStrongNameCheck = itemsToSkipStrongNameCheck ?? Array.Empty <string>();
     _telemetry            = telemetry;
     _hashToCollisionIdMap = hashToCollisionIdMap;
 }
Exemplo n.º 5
0
        private void GenerateOrchestrationManifest(BatchSignInput batchData, string outputPath)
        {
            _log.LogMessage(MessageImportance.High, $"Generating orchestration file manifest into {outputPath}");
            OrchestratedFileJson fileJsonWithInfo = new OrchestratedFileJson
            {
                ExcludeList = Array.Empty <string>()
            };

            var distinctSigningCombos = batchData.FilesToSign.GroupBy(fileToSign => new { fileToSign.SignInfo.Certificate, fileToSign.SignInfo.StrongName });
            var contentUtil           = new ContentUtil();

            List <OrchestratedFileSignData> newList = new List <OrchestratedFileSignData>();

            foreach (var combinationToSign in distinctSigningCombos)
            {
                var filesInThisGroup = combinationToSign.Select(combination => new FileSignDataEntry()
                {
                    FilePath         = combination.FullPath,
                    SHA256Hash       = contentUtil.GetChecksum(combination.FullPath),
                    PublishToFeedUrl = batchData.PublishUri
                });
                newList.Add(new OrchestratedFileSignData()
                {
                    Certificate = combinationToSign.Key.Certificate,
                    StrongName  = combinationToSign.Key.StrongName,
                    FileList    = filesInThisGroup.ToArray()
                });
            }
            fileJsonWithInfo.SignList = newList.ToArray();
            fileJsonWithInfo.Kind     = "orchestration";

            using (StreamWriter file = File.CreateText(outputPath))
            {
                file.Write(JsonConvert.SerializeObject(fileJsonWithInfo, Formatting.Indented));
            }
        }
Exemplo n.º 6
0
 internal BatchSignUtil(IBuildEngine buildEngine, TaskLoggingHelper log, SignTool signTool, BatchSignInput batchData)
 {
     _signTool    = signTool;
     _batchData   = batchData;
     _log         = log;
     _buildEngine = buildEngine;
 }