public ActionResult <DecryptMessageModel> Encrypt([FromBody] EncryptMessageModel input) { return(Ok(new DecryptMessageModel { data = _encryptionService.Encrypt(input.secret) })); }
public async Task <DecryptMessageModel> EncryptAsync(EncryptMessageModel message) { var httpResponse = await httpClient.PostAsync($"{configuration["encryptionUrl"]}/api/encrypt", new StringContent(JsonConvert.SerializeObject(message))); var response = await httpResponse.Content.ReadAsStringAsync(); return(JsonConvert.DeserializeObject <DecryptMessageModel>(response)); }
public IHttpActionResult EncryptMessage(EncryptMessageModel model) { var cypherText = _cryptoService.Encrypt(model.Message, model.Key); var obj = new { Success = true, Message = "", Result = cypherText }; return(Ok(obj)); }
public ActionResult <DecryptMessageModel> Encrypt([FromBody] EncryptMessageModel input) { return(Ok(_encryptionService.EncryptAsync(input))); }