create tool to generate signing key when sn.exe is not present add build info to readme add DOTNET_INSTALL_PATH to Makefile.local and try to detect
30 lines
760 B
C#
30 lines
760 B
C#
using System;
|
|
using System.IO;
|
|
using System.Security.Cryptography;
|
|
|
|
namespace CreateSigningKey
|
|
{
|
|
class Program
|
|
{
|
|
static void Main(string[] args)
|
|
{
|
|
args = new[] { "or-tools.snk" };
|
|
if (args == null || args.Length == 0)
|
|
{
|
|
Console.WriteLine("Key filename not specified.");
|
|
return;
|
|
}
|
|
|
|
File.WriteAllBytes(args[0], GenerateStrongNameKeyPair());
|
|
}
|
|
|
|
public static byte[] GenerateStrongNameKeyPair()
|
|
{
|
|
using (var provider = new RSACryptoServiceProvider(1024, new CspParameters() { KeyNumber = 2 }))
|
|
{
|
|
return provider.ExportCspBlob(!provider.PublicOnly);
|
|
}
|
|
}
|
|
}
|
|
}
|