Files
ortools-clone/tools/netstandard/CreateSigningKey/Program.cs
ziad 6207fbed49 fix bugs in osx build
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
2018-02-08 05:41:08 -08:00

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);
}
}
}
}