-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
28 lines (22 loc) · 792 Bytes
/
Program.cs
File metadata and controls
28 lines (22 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using LicenseKey.Generator.LicenseKeyGenerator;
bool useColor = !Console.IsOutputRedirected
&& !args.Contains("--no-color", StringComparer.OrdinalIgnoreCase);
WriteLineWithOptionalColor("=== License Key Generator Started ===", ConsoleColor.Magenta, useColor);
Console.WriteLine();
ECDsaLicenseKeyCreator.GenerateLicenseKeys(useColor);
Console.WriteLine();
WriteLineWithOptionalColor(
"License key generation completed. Copy the private key PEM into your secret manager and distribute only the public key.",
ConsoleColor.Green,
useColor);
static void WriteLineWithOptionalColor(string message, ConsoleColor color, bool useColor)
{
if (!useColor)
{
Console.WriteLine(message);
return;
}
Console.ForegroundColor = color;
Console.WriteLine(message);
Console.ResetColor();
}