[GH-ISSUE #34] Enhanced license expiration time verification mechanism #29

Closed
opened 2026-02-26 01:35:48 +03:00 by kerem · 3 comments
Owner

Originally created by @shushu789 on GitHub (May 9, 2024).
Original GitHub issue: https://github.com/junian/Standard.Licensing/issues/34

Hello, this is a great library, it's great. But I want to know whether the verification mechanism of the license expiration time can be enhanced to add verification with the Internet time, because if the user modifies the local system time, the license can be made valid forever. If I missed something, please forgive me. Thanks

Originally created by @shushu789 on GitHub (May 9, 2024). Original GitHub issue: https://github.com/junian/Standard.Licensing/issues/34 Hello, this is a great library, it's great. But I want to know whether the verification mechanism of the license expiration time can be enhanced to add verification with the Internet time, because if the user modifies the local system time, the license can be made valid forever. If I missed something, please forgive me. Thanks
kerem closed this issue 2026-02-26 01:35:48 +03:00
Author
Owner

@markadrake commented on GitHub (Jun 8, 2024):

@shushu789 what you stated looks true to me:

github.com/junian/Standard.Licensing@dfbad0e079/src/Standard.Licensing/Validation/LicenseValidationExtensions.cs (L58)

An additional method in the validation chain could be to phone home using a network time protocol and a built-in/configurable tolerance.

<!-- gh-comment-id:2156054378 --> @markadrake commented on GitHub (Jun 8, 2024): @shushu789 what you stated looks true to me: https://github.com/junian/Standard.Licensing/blob/dfbad0e0792f66abf97c848aec8595cabbfeceeb/src/Standard.Licensing/Validation/LicenseValidationExtensions.cs#L58 An additional method in the validation chain could be to phone home using a network time protocol and a built-in/configurable tolerance.
Author
Owner

@shushu789 commented on GitHub (Jun 8, 2024):

@markadrake Thanks for your reply, I implemented this problem myself using NTP time, and it works well now

<!-- gh-comment-id:2156057187 --> @shushu789 commented on GitHub (Jun 8, 2024): @markadrake Thanks for your reply, I implemented this problem myself using NTP time, and it works well now
Author
Owner

@junian commented on GitHub (Jun 9, 2024):

Hi @shushu789,

Thanks for bringing this up. I added an extenstion in v1.1.9 to use custom DateTime. Now you can do something like this:

var serverTime = GetServerTime();
var validationFailures = license.Validate()  
                                .ExpirationDate(systemDateTime: serverTime)  
                                .When(lic => lic.Type == LicenseType.Trial)  
                                .And()  
                                .Signature(publicKey)  
                                .AssertValidLicense();
<!-- gh-comment-id:2156250328 --> @junian commented on GitHub (Jun 9, 2024): Hi @shushu789, Thanks for bringing this up. I added an extenstion in v1.1.9 to use custom DateTime. Now you can do something like this: ```csharp var serverTime = GetServerTime(); var validationFailures = license.Validate() .ExpirationDate(systemDateTime: serverTime) .When(lic => lic.Type == LicenseType.Trial) .And() .Signature(publicKey) .AssertValidLicense(); ```
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Standard.Licensing#29
No description provided.