public bool IsValidKey(string key) { bool result; try { key = KeyStringFormatter.ParseKey(key); License license = LicenseConverter.KeyToLicense(this.decoder, key); result = LicenseVerificator.IsValid(license, DateTime.UtcNow); } catch (LicensingException) { result = false; } return(result); }
public bool RegisterKey(string key) { key = KeyStringFormatter.ParseKey(key); License license = LicenseConverter.KeyToLicense(this.decoder, key); if (!LicenseVerificator.IsValid(license, DateTime.UtcNow)) { return(false); } this.privateStorer.SaveKey(key); this.CacheLicense(license); if (this.RegistrationChanged != null) { this.RegistrationChanged(this); } return(true); }
public static string ParseKey(string formattedKey) { return(KeyStringFormatter.RemoveChars(formattedKey, KeyStringFormatter.ReplaceSymbols)); }
public License ParseKey(string key) { key = KeyStringFormatter.ParseKey(key); return(LicenseConverter.KeyToLicense(this.decoder, key)); }