Eziriz.Reactor.LicenseGenerator
7.7.1
dotnet add package Eziriz.Reactor.LicenseGenerator --version 7.7.1
NuGet\Install-Package Eziriz.Reactor.LicenseGenerator -Version 7.7.1
<PackageReference Include="Eziriz.Reactor.LicenseGenerator" Version="7.7.1" />
<PackageVersion Include="Eziriz.Reactor.LicenseGenerator" Version="7.7.1" />
<PackageReference Include="Eziriz.Reactor.LicenseGenerator" />
paket add Eziriz.Reactor.LicenseGenerator --version 7.7.1
#r "nuget: Eziriz.Reactor.LicenseGenerator, 7.7.1"
#:package Eziriz.Reactor.LicenseGenerator@7.7.1
#addin nuget:?package=Eziriz.Reactor.LicenseGenerator&version=7.7.1
#tool nuget:?package=Eziriz.Reactor.LicenseGenerator&version=7.7.1
.NET Reactor License Generator
Generate .NET Reactor license files programmatically on a trusted server or administrator workstation. This package is the automation counterpart to the License Manager in .NET Reactor.
Security: Do not ship this package, an
.nrprojfile, a master key, or signing credentials with an end-user application. License generation belongs on infrastructure you control.
Supported targets
| Target framework | Assembly | External-signing request types |
|---|---|---|
| .NET Framework 4.0 or later | LicenseGen.dll |
Strings for .NET 4.0 compatibility |
| .NET Standard 2.0 | LicenseGenNetStandard.dll |
HashAlgorithmName and RSASignaturePadding |
The public LicenseGenerator type is in the global namespace in both assemblies.
Install
dotnet add package Eziriz.Reactor.LicenseGenerator --version 7.7.1
Create a license file
Use the same saved .nrproj project and master key that were used to protect the application:
var generator = new LicenseGenerator("MyApplication.nrproj");
// This example creates a license that is not tied to one computer.
generator.Hardware_Enabled = false;
generator.CreateLicenseFile("MyApplication.license");
For a hardware-locked license, set Hardware_Enabled to true and assign the complete hardware ID to HardwareID before creating the file.
You can also load a master key separately:
var generator = new LicenseGenerator();
generator.LoadMasterKeyFromFile("MyApplication.mkey");
generator.CreateLicenseFile("MyApplication.license");
The master key must match the key embedded when the application was protected. A license created with another master key will not be accepted.
External signing with a KMS or HSM
Version 7.7.1 can keep the RSA private key inside a KMS or HSM. Provision a public-only master key once, store it, and reuse it:
string masterKey = LicenseGenerator.CreatePublicOnlyMasterKeyFromPEM(
File.ReadAllText("license-signing-public.pem"));
File.WriteAllText("MyApplication-public.mkey", masterKey);
The provisioning methods accept:
CreatePublicOnlyMasterKeyFromDER(byte[]): X.509 SubjectPublicKeyInfo or PKCS#1RSAPublicKeyCreatePublicOnlyMasterKeyFromPEM(string):PUBLIC KEYorRSA PUBLIC KEYCreatePublicOnlyMasterKeyFromXML(string): public<RSAKeyValue>containing onlyModulusandExponent
RSA keys must be at least 3072 bits. Each provisioning call creates a new random 256-bit license-payload key, so call it only once for a master key and persist the result. Private PEM/XML keys are not accepted by this provisioning API.
Load the public-only master key and send the supplied digest to your signing service:
var generator = new LicenseGenerator();
generator.LoadMasterKeyFromFile("MyApplication-public.mkey");
byte[] license = await generator.CreateLicenseFileAsync(async request =>
{
// For RSA-3072 with the .NET Standard build:
// request.HashAlgorithmName == HashAlgorithmName.SHA256
// request.SignaturePadding == RSASignaturePadding.Pkcs1
return await SignDigestWithKmsOrHsmAsync(
request.Digest,
request.HashAlgorithmName,
request.SignaturePadding);
});
File.WriteAllBytes("MyApplication.license", license);
SignDigestWithKmsOrHsmAsync represents your provider-specific integration. The callback must return a PKCS#1 v1.5 signature over request.Digest; it must not hash the digest again. The library verifies the returned signature locally before it creates the license.
In the .NET Framework 4.0 build, the request intentionally uses strings because the BCL types were introduced later:
HashAlgorithmName: for example,"SHA256"SignaturePadding:"PKCS#1 v1.5"
Runtime license checks
This package creates license files. To read the license status or obtain a hardware ID from a protected application, use the Eziriz.Reactor.Licensing package (License.dll) instead.
Documentation
License
This package is licensed under the MIT License. You may use, copy, modify, distribute, sublicense, or sell copies, provided that the MIT copyright and license notice are retained.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net40 is compatible. net403 was computed. net45 was computed. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.0
- No dependencies.
-
.NETStandard 2.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version 7.7.1 adds external RSA signing with local signature verification and public-only master-key provisioning from DER, PEM, or RSA XML public keys. The .NET Standard API exposes HashAlgorithmName and RSASignaturePadding; the .NET Framework 4.0 build retains string properties for compatibility.