Files
ortools-clone/tools/dotnet/CreateSigningKey/Program.cs
Corentin Le Molgat 62cbe9a228 dotnet: Full Rework
- Create native project runtime.{rid}.Google.OrTools
  - follow the microsoft convention e.g.:
  https://www.nuget.org/packages/Microsoft.NETCore.App/
  https://www.nuget.org/packages/runtime.linux-x64.Microsoft.NETCore.App/
- Target `make_dotnet` targets local nupkg instead of dll.
- Use 4096 RSA key for or-tools.snk
- Clean nuget cache in `clean_dotnet` recipe

Refactor:
- Move cs files to ortools/*/csharp
- Move dotnet project to ortools/dotnet/Google.OrTools
- Move example generation to temp_dotnet
  - Avoid to mess the `BIN_DIR`
- Rework Google.OrTools.FSharp

Cleanup:
- Remove deps to netfx.props since we only support:
  netstandard2.0 TFM and netcoreapp2.1 Runtime TFM
- Remove OrTools.nuspec.in
  -> use newly added properties to .csproj format
- Remove of ortools/dotnet/OrTools project
  - replaced by ortools/dotnet/Google.OrTools
- Remove provided protobuf.dll.
  - Automatically retrieved from nuget.org

Misc:
- Add **/*.csproj to gitignore
- Add **/runtime.json to gitignore

- dotnet: Makefile windows fix
  - make.exe doesn't support `else ifeq`
2018-08-30 11:58:47 +02:00

25 lines
716 B
C#

using System;
using System.IO;
using System.Security.Cryptography;
namespace CreateSigningKey {
class Program {
static void Main(string[] args) {
if (args == null || args.Length == 0) {
Console.WriteLine("Key filename not specified.");
return;
}
string path = Directory.GetCurrentDirectory() + args[0];
Console.WriteLine("Key filename:" + path);
if (Console.Out!=null) Console.Out.Flush();
File.WriteAllBytes(path, GenerateStrongNameKeyPair());
}
public static byte[] GenerateStrongNameKeyPair() {
using (var provider = new RSACryptoServiceProvider(4096)) {
return provider.ExportCspBlob(!provider.PublicOnly);
}
}
}
}