Beispiel #1
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (ReportDocumentId == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "ReportDocumentId");
     }
     if (Url == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Url");
     }
     if (EncryptionDetails == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "EncryptionDetails");
     }
     if (EncryptionDetails != null)
     {
         EncryptionDetails.Validate();
     }
 }
Beispiel #2
0
 public PSEncryptionDetails(EncryptionDetails encryption)
 {
     this.DoubleEncryptionEnabled   = encryption?.DoubleEncryptionEnabled;
     this.CustomerManagedKeyDetails = encryption?.Cmk != null ? new PSCustomerManagedKeyDetails(encryption?.Cmk) : null;
 }
 public JsonResult DecryptString(EncryptionDetails encDetails)
 {
     return(new JsonResult(EncryptionHelper.Instance.DecryptString_Aes(encDetails)));
     //return new JsonResult(_protector.Unprotect(str));
 }