public string Post(ToEncrypt pToEncrypt) { if (this.ThereArePostError(pToEncrypt)) { return(new Microsoft.AspNetCore.Mvc.BadRequestResult().ToString()); } return (RSAManager.GetInstance().EncryptWithPublicKeyString(pToEncrypt.text, pToEncrypt.key).ToString()); }
private bool ThereArePostError(ToEncrypt pToEncrypt) { if (pToEncrypt is null) { return(true); } if (string.IsNullOrEmpty(pToEncrypt.key) || string.IsNullOrEmpty(pToEncrypt.text)) { return(true); } return(false); }
private async Task <string> SendToEncryptationService(ToEncrypt pToEncrypt) { return(await UtilsHTTP.GetInstance().POSTJsonAsyncToURL( UtilsConstants.UrlConstants.URL_SECURITY_ENCRIPTATION_REST, pToEncrypt)); }
public string Post(ToEncrypt pToEncrypt) { return(this.SendToEncryptationService(pToEncrypt).Result); }