ARSoft.WinFormsLicensing
1.4.2
dotnet add package ARSoft.WinFormsLicensing --version 1.4.2
NuGet\Install-Package ARSoft.WinFormsLicensing -Version 1.4.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ARSoft.WinFormsLicensing" Version="1.4.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ARSoft.WinFormsLicensing" Version="1.4.2" />
<PackageReference Include="ARSoft.WinFormsLicensing" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ARSoft.WinFormsLicensing --version 1.4.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ARSoft.WinFormsLicensing, 1.4.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ARSoft.WinFormsLicensing@1.4.2
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ARSoft.WinFormsLicensing&version=1.4.2
#tool nuget:?package=ARSoft.WinFormsLicensing&version=1.4.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ARSoft WinForms Licensing
A robust time-based licensing library for Windows Forms applications that provides secure license management with encryption, dual storage, and comprehensive validation.
🚀 Features
- Time-based Licensing: Create licenses with configurable expiration periods
- Dual Storage: Stores licenses in both local files and Windows Registry
- Encryption: AES encryption with PBKDF2 key derivation
- Tamper Protection: SHA256 checksums prevent license modification
- Flexible Distribution: Direct data registration or encrypted .lic file import
- Logging: Built-in with Microsoft.Extensions.Logging
- Dual Usage Patterns:
ForCreation()
andForValidation()
- Extended Default License: 366-day default validity
- License Detection: Built-in presence and validation methods
📦 Installation
PM> Install-Package ARSoft.WinFormsLicensing
or
dotnet add package ARSoft.WinFormsLicensing
🔧 Core Concepts
Factory Methods
ForCreation()
– Full-featured manager for vendor tools and registration (requires password & salt)ForValidation()
– Lightweight manager for client-side validation only
License Lifecycle
- Creation: Generate and distribute licenses (default 366 days)
- Registration: Import or enter license data in customer app
- Validation: Multi-layer validation (checksum + expiration)
- Storage: Saved to both
%AppData%
and Windows Registry
Security
- AES + PBKDF2 (100k iterations, SHA256)
- SHA256 checksums for tamper detection
- Client hashing (no sensitive info stored)
🛠️ Basic Implementation
Initialization
// Vendor side (creation/registration)
var licenseManager = LicenseManager.ForCreation(
logger, "StrongPassword123!", Encoding.UTF8.GetBytes("UniqueSalt123"),
"MyApp", "license.json", "SOFTWARE\MyCompany\MyApp\License");
// Client side (validation only)
var licenseManager = LicenseManager.ForValidation(
"MyApp", "license.json", "SOFTWARE\MyCompany\MyApp\License");
License Workflows
Workflow A: Direct Registration
- Vendor creates license with
CreateLicense()
- Customer enters license data in registration window
- Application registers via
RenewLicense()
Workflow B: File Distribution
- Vendor generates encrypted
.lic
file withLicenseGenerator.GenerateLicenseFile()
- Customer imports using
ImportLicenseFile()
Workflow C: Hybrid
- Initial registration by data
- Renewals via
.lic
files
License Validation
if (!licenseManager.IsLicensePresent()) { ShowRegistrationForm(); return; }
var (isValid, message, days) = licenseManager.ValidateLicense();
if (!isValid) { ShowError(message); Application.Exit(); }
if (days <= 30) { ShowWarning(message); }
📝 Configuration
Factory Methods
Method | Purpose |
---|---|
ForCreation() |
Vendor tools, registration |
ForValidation() |
Client validation only |
Key Methods
Method | Available In | Description |
---|---|---|
CreateLicense() |
Creation | Create and store license |
ValidateLicense() |
Both | Validate license integrity & expiry |
IsLicensePresent() |
Both | Check if license exists |
RenewLicense() |
Creation | Register license from data |
ImportLicenseFile() |
Creation | Import .lic file |
Storage
- File:
%AppData%\[AppName]\[SettingsFile]
- Registry:
HKEY_CURRENT_USER\[RegistryKeyPath]
🔒 Best Practices
- Use strong password + unique salt (≥8 bytes)
- Distribute licenses securely (encrypted channels)
- Validate on startup and periodically
- Handle validation errors gracefully
- Keep password/salt consistent across vendor & client
📋 Requirements
- .NET 6.0+
- Windows OS (registry required)
- Microsoft.Extensions.Logging
- Newtonsoft.Json
📄 License
MIT License - see LICENSE
📞 Support
Open an issue on GitHub for bug reports or feature requests.
🔄 Version History
v1.4.2
- Minor fixes and performance improvements
v1.4.1
- Minor fixes and performance improvements
v1.4.0
- Added
ImportLicenseFile()
- Added
LicenseGenerator
utility
v1.3.0
- Breaking: LicenseUtils made public
- Enhanced validation & error handling
v1.2.0
- Introduced factory methods (
ForCreation
/ForValidation
) - Added
IsLicensePresent()
andLoadValidLicense()
v1.0.0
- Initial release (time-based, dual storage, AES encryption)
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0-windows10.0.17763 is compatible. net9.0-windows was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0-windows10.0.17763
- Microsoft.Extensions.Logging (>= 9.0.8)
- Newtonsoft.Json (>= 13.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.4.2 | 133 | 9/5/2025 |