DotNet Reference

DotNet Reference

Program.cs
Go to the documentation of this file.
1 using System;
2 using System.IO;
3 using System.Security.Cryptography;
4 
5 namespace CreateSigningKey {
6  class Program {
7  static void Main(string[] args) {
8  if (args == null || args.Length == 0) {
9  Console.WriteLine("Key filename not specified.");
10  return;
11  }
12  string path = Directory.GetCurrentDirectory() + args[0];
13  Console.WriteLine("Key filename:" + path);
14  if (Console.Out!=null) Console.Out.Flush();
15  File.WriteAllBytes(path, GenerateStrongNameKeyPair());
16  }
17 
18  public static byte[] GenerateStrongNameKeyPair() {
19  using (var provider = new RSACryptoServiceProvider(4096)) {
20  return provider.ExportCspBlob(!provider.PublicOnly);
21  }
22  }
23  }
24 }
Definition: Program.cs:5
Definition: Program.cs:6
static byte[] GenerateStrongNameKeyPair()
Definition: Program.cs:18