Standalone .NET 4.7.2 console tool for NcProgramManager offline licensing. - keygen: RSA 2048-bit key pair generation - fingerprint: WMI machine fingerprint (Windows only) - sign: RSA-SHA256 sign fingerprint, write .lic file Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
46 lines
1.6 KiB
C#
46 lines
1.6 KiB
C#
using System;
|
|
using LicenseGenerator.Commands;
|
|
|
|
namespace LicenseGenerator
|
|
{
|
|
internal class Program
|
|
{
|
|
private static void Main(string[] args)
|
|
{
|
|
var input = InputArgs.Parse(args);
|
|
switch (input.Command)
|
|
{
|
|
case "keygen":
|
|
KeygenCommand.Execute();
|
|
break;
|
|
case "fingerprint":
|
|
FingerprintCommand.Execute();
|
|
break;
|
|
case "sign":
|
|
SignCommand.Execute(input);
|
|
break;
|
|
default:
|
|
PrintUsage();
|
|
Environment.Exit(1);
|
|
break;
|
|
}
|
|
}
|
|
|
|
private static void PrintUsage()
|
|
{
|
|
Console.WriteLine("LicenseGenerator — NcProgramManager license tool");
|
|
Console.WriteLine();
|
|
Console.WriteLine("Commands:");
|
|
Console.WriteLine(" keygen");
|
|
Console.WriteLine(" Generate RSA 2048-bit key pair.");
|
|
Console.WriteLine(" Writes private.key.xml to current dir.");
|
|
Console.WriteLine(" Prints public key XML to stdout.");
|
|
Console.WriteLine();
|
|
Console.WriteLine(" fingerprint");
|
|
Console.WriteLine(" Print machine fingerprint (Windows + WMI required).");
|
|
Console.WriteLine();
|
|
Console.WriteLine(" sign -key=<private.key.xml> -fingerprint=<fp> [-out=<license.lic>]");
|
|
Console.WriteLine(" Sign machine fingerprint, write .lic file.");
|
|
}
|
|
}
|
|
}
|