43 lines
1.1 KiB
C#
43 lines
1.1 KiB
C#
using IronLicensing.Client.Models;
|
|
|
|
namespace IronLicensing.Client;
|
|
|
|
public interface ILicenseCache
|
|
{
|
|
/// <summary>
|
|
/// Gets the cached license information
|
|
/// </summary>
|
|
Task<CachedLicenseData?> GetCachedLicenseAsync();
|
|
|
|
/// <summary>
|
|
/// Saves license information with optional signature for offline verification
|
|
/// </summary>
|
|
Task SaveLicenseAsync(LicenseInfo license, string? signature, string? signingPublicKey);
|
|
|
|
/// <summary>
|
|
/// Clears all cached license data
|
|
/// </summary>
|
|
Task ClearAsync();
|
|
|
|
/// <summary>
|
|
/// Gets the cached signing public key
|
|
/// </summary>
|
|
Task<string?> GetSigningPublicKeyAsync();
|
|
|
|
/// <summary>
|
|
/// Saves the signing public key
|
|
/// </summary>
|
|
Task SaveSigningPublicKeyAsync(string publicKey);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Cached license data including signature for offline verification
|
|
/// </summary>
|
|
public class CachedLicenseData
|
|
{
|
|
public LicenseInfo License { get; set; } = null!;
|
|
public string? Signature { get; set; }
|
|
public string? SigningPublicKey { get; set; }
|
|
public string? RawLicenseJson { get; set; }
|
|
}
|