private bool validate_license_term(LicenseTerm license) { if(license.StartDate <= DateTime.Now && license.EndDate >= DateTime.Now) { return validate_data (license.GetReferenceString (), license.Base64Hash); } return false; }
private string get_license_term_key(LicenseTerm license) { if(validate_license_term(license)) { return decrypt_data_base64(license.Key); } return String.Empty; }
private License remove_term(License license, LicenseTerm licenseTerm) { return remove_term (license, licenseTerm.Name); }
private License add_term(License license, LicenseTerm licenseTerm) { license.AddTerm (licenseTerm); license.Base64Hash = sign_data_base64 (license.GetReferenceString ()); return license; }
// License Term //////////////////////////// private LicenseTerm create_license_term(DateTime start, DateTime end, string name, string key) { LicenseTerm lt = new LicenseTerm (){ StartDate = start, EndDate = end, Name = name, Key = encrypt_data_base64(key) }; lt.Base64Hash = sign_data_base64 (lt.GetReferenceString ()); return lt; }
public static bool ValidateLicenseTerm(LicenseTerm licenseTerm) { return Instance.validate_license_term (licenseTerm); }
public void AddTerm(LicenseTerm licenseTerm) { LicenseTermList.Add (licenseTerm); }
public static License RemoveTerm(License license, LicenseTerm term) { return Instance.remove_term (license, term); }
public static string GetLicenseTermKey(LicenseTerm licenseTerm) { return Instance.get_license_term_key (licenseTerm); }
public static License AddTerm(License license, LicenseTerm licenseTerm) { return Instance.add_term (license, licenseTerm); }