43 lines
1.0 KiB
C#
43 lines
1.0 KiB
C#
using System;
|
|
|
|
namespace Footwear_Test_methodsfor_wholeshoe_Slipresistanceperformance.Models
|
|
{
|
|
public enum LicenseStage
|
|
{
|
|
FirstPeriod,
|
|
SecondPeriod,
|
|
Permanent
|
|
}
|
|
|
|
public enum LicenseCheckState
|
|
{
|
|
NotInitialized,
|
|
Valid,
|
|
Expired,
|
|
Tampered
|
|
}
|
|
|
|
public sealed record PasswordSecret(string Salt, string Hash);
|
|
|
|
public sealed record LicenseData(
|
|
string InstallId,
|
|
LicenseStage Stage,
|
|
DateTime StageStartedUtc,
|
|
DateTime LastTrustedUtc,
|
|
int FirstPeriodMonths,
|
|
int SecondPeriodMonths,
|
|
PasswordSecret AdminPassword,
|
|
PasswordSecret FirstUnlockPassword,
|
|
PasswordSecret SecondUnlockPassword);
|
|
|
|
public sealed record LicenseCheckResult(
|
|
LicenseCheckState State,
|
|
LicenseStage Stage,
|
|
DateTime? ExpiresUtc,
|
|
string Message)
|
|
{
|
|
public bool CanUseSoftware => State == LicenseCheckState.Valid;
|
|
public bool RequiresUnlock => State == LicenseCheckState.Expired;
|
|
}
|
|
}
|