[GH-ISSUE #41] Require solid date checking #35

Closed
opened 2026-02-26 01:35:49 +03:00 by kerem · 1 comment
Owner

Originally created by @xmenxwk on GitHub (Oct 10, 2024).
Original GitHub issue: https://github.com/junian/Standard.Licensing/issues/41

License can easily be manipulated by changing the system date.

Originally created by @xmenxwk on GitHub (Oct 10, 2024). Original GitHub issue: https://github.com/junian/Standard.Licensing/issues/41 License can easily be manipulated by changing the system date.
kerem closed this issue 2026-02-26 01:35:49 +03:00
Author
Owner

@junian commented on GitHub (Oct 10, 2024):

It's outside the scope of this library. You can get time from an NTP server and compare it in validation.

var networkTime = GetNTPTime();

var validationFailures = license.Validate()  
                                .ExpirationDate(systemDateTime: networkTime)  
                                .When(lic => lic.Type == LicenseType.Trial)  
                                .And()  
                                .Signature(publicKey)  
                                .AssertValidLicense();

Or if you have a better idea, feel free to send a PR. Thanks!

<!-- gh-comment-id:2406124008 --> @junian commented on GitHub (Oct 10, 2024): It's outside the scope of this library. You can get time from an NTP server and compare it in validation. ```csharp var networkTime = GetNTPTime(); var validationFailures = license.Validate() .ExpirationDate(systemDateTime: networkTime) .When(lic => lic.Type == LicenseType.Trial) .And() .Signature(publicKey) .AssertValidLicense(); ``` Or if you have a better idea, feel free to send a PR. Thanks!
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#35
No description provided.