License Key System
Hey, how would you implement a licensing system?
I basically need those 3 things:
- Online key validation (e.g. HTTP endpoint)
- Offline key validation fallback
- Blacklisting license keys
I know that this doesn't protect piracy in any way but I don't need that anyway.
The basic license check control flow would be the following:
1. Startup
2. Check license key
3. Continue startup or terminate app
I know that IdentityServer uses some kind of licensing system aswell but looking at the source it kinda looks quite complicated.
I also found this library: https://github.com/appsoftwareltd/dotnet-licence-key-generator
Not sure if this is good though.
Tl;dr:
Is there already a library which fullfills my goals and/or how would I implement offline license validation?
GitHub
GitHub - appsoftwareltd/dotnet-licence-key-generator: Key Generatio...
Key Generation and Verification System component .NET Core 1.0+, .NET Framework 4.5+ - GitHub - appsoftwareltd/dotnet-licence-key-generator: Key Generation and Verification System component .NET Co...
7 Replies
Another idea was to use JWTs which can be validated offline and add a blacklist on top
Hey @Dusty, I'm kind of necro posting here, so I'm sorry about that haha. But I was just about to post the exact same question.
I was looking at using RSA maybe for key gen and validation, but not super clear to me.
Anyway, I was wondering what solution you ended up with?
(Or if anyone else has a suggestions.)
Crazy necro but no worries haha, I Ended Up using RSA
I know right haha. Honestly wouldn't have if it wasn't like the exact same setup I am doing with the exact same considerations.
Cool, thanks that is what I was leaning towards too. I appreciate it!
Yea that's the smartest way of doing it iirc
Any ideas on how to tie the license to a UUID? Usually deploying on airgapped environments
Should be able to just make it part of the key if you are using RSA.