/// <exception cref="IOException"></exception>
        internal override void SignAssembly(StrongNameKeys keys, Stream inputStream, Stream outputStream)
        {
            Debug.Assert(inputStream is TempFileStream);

            var tempStream = (TempFileStream)inputStream;
            string assemblyFilePath = tempStream.Name;
            tempStream.DisposeUnderlyingStream();

            if (keys.KeyContainer != null)
            {
                Sign(assemblyFilePath, keys.KeyContainer);
            }
            else
            {
                Sign(assemblyFilePath, keys.KeyPair);
            }

            using (var fileToSign = new FileStream(assemblyFilePath, FileMode.Open))
            {
                fileToSign.CopyTo(outputStream);
            }
        }
Ejemplo n.º 2
0
 internal abstract void SignAssembly(StrongNameKeys keys, Stream inputStream, Stream outputStream);