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>
38 lines
1.2 KiB
C#
38 lines
1.2 KiB
C#
namespace LicenseGenerator
|
|
{
|
|
internal class InputArgs
|
|
{
|
|
internal string Command { get; private set; }
|
|
internal string KeyPath { get; private set; }
|
|
internal string Fingerprint { get; private set; }
|
|
internal string OutPath { get; private set; }
|
|
|
|
private InputArgs() { }
|
|
|
|
internal static InputArgs Parse(string[] args)
|
|
{
|
|
var result = new InputArgs
|
|
{
|
|
Command = args.Length > 0 ? args[0].ToLowerInvariant() : string.Empty,
|
|
OutPath = "license.lic"
|
|
};
|
|
|
|
for (int i = 1; i < args.Length; i++)
|
|
{
|
|
string arg = args[i];
|
|
int eq = arg.IndexOf('=');
|
|
if (eq < 0) continue;
|
|
string key = arg.Substring(0, eq).TrimStart('-').ToLowerInvariant();
|
|
string val = arg.Substring(eq + 1);
|
|
switch (key)
|
|
{
|
|
case "key": result.KeyPath = val; break;
|
|
case "fingerprint": result.Fingerprint = val; break;
|
|
case "out": result.OutPath = val; break;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
}
|
|
}
|