Esempio n. 1
0
 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;
 }
Esempio n. 2
0
 // 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;
 }