https://github.com/mhmmdsmdi/autolicensing
This package provides an open-source license manager.
https://github.com/mhmmdsmdi/autolicensing
asp asp-net-core csharp license license-management licensing microservice wpf
Last synced: 12 months ago
JSON representation
This package provides an open-source license manager.
- Host: GitHub
- URL: https://github.com/mhmmdsmdi/autolicensing
- Owner: mhmmdsmdi
- Created: 2024-01-20T04:09:52.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2025-03-03T11:15:02.000Z (over 1 year ago)
- Last Synced: 2025-06-20T03:18:44.413Z (about 1 year ago)
- Topics: asp, asp-net-core, csharp, license, license-management, licensing, microservice, wpf
- Language: C#
- Homepage:
- Size: 64.5 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AutoLicensing
[](https://www.nuget.org/packages/AutoLicensing/)
This package provides an open-source license manager.
## Usage
Use this command to add AutoLicensing to your project.
```C#
dotnet add package AutoLicensing --version 1.0.5
```
### Generate license
```C#
var key = LicenseKeyGenerator.GenerateRsaKeyPair();
var privateKey = key.PrivateKey;
var publicKey = key.PublicKey;
var signedLicense = new LicenseFactory()
.WithRsaPrivateKey(key.PrivateKey)
.WithName("Enterprise License")
.WithCustomerName("Some Guy")
.WithProduct(new LicenseProductFactory()
.WithName("Application 1")
.WithExpiryDate(DateTime.Now.AddDays(180))
.WithAttribute("Limitation 1", 100)
.WithFeature("Feature 1")
.WithFeature("Feature 2")
.Create())
.SignAndCreate();
var licenseKey = signedLicense.Export();
```
### Verify license
```C#
var signedLicense = Licenser.Verifier
.WithRsaPublicKey(publicKey)
.LoadAndVerify(licenseKey);
```
## Misc.
You can change the confusing bytes by using this code
```C#
Confuser.ConfusingBytes = "Some random bytes"u8.ToArray();
```