-
-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add logic to get license key information
- Loading branch information
Showing
3 changed files
with
37 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using Nager.LicenseSystem; | ||
|
||
namespace Nager.Date.Helpers | ||
{ | ||
/// <summary> | ||
/// License Helper | ||
/// </summary> | ||
public static class LicenseHelper | ||
{ | ||
/// <summary> | ||
/// Get License Key Informations | ||
/// </summary> | ||
/// <param name="licenseKey"></param> | ||
/// <returns></returns> | ||
public static LicenseInfo CheckLicenseKey(string licenseKey) | ||
{ | ||
var licenseKeyConfiguration = new LicenseKeyConfiguration | ||
{ | ||
Part1 = "DCDCB65FD3009576BC11E23C883220F6292709DEB93174D0913D2E89DB3D5D88", | ||
Part2 = "17F32AEC71CCB3D20166DCC7F49B32C1153464105344608692E005B16284A41D" | ||
}; | ||
|
||
var licenseKeyValidator = new LicenseKeyValidator(licenseKeyConfiguration); | ||
if (licenseKeyValidator.Validate(licenseKey, out var licenseInfo)) | ||
{ | ||
return licenseInfo; | ||
} | ||
|
||
return null; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters