protected internal override void WriteJsonParams(string jsonParamsString, HttpWebRequest request) { if (string.IsNullOrEmpty(SessionKey)) { base.WriteJsonParams(jsonParamsString, request); } else { Encrypted cipher = new Encrypted(jsonParamsString, SessionKey, SessionIV); string postData = cipher.Base64Cipher; using (StreamWriter sw = new StreamWriter(request.GetRequestStream())) { sw.Write(postData); } ApiEncryptionValidation.SetEncryptedValidationToken(request, jsonParamsString, SessionInfo.PublicKey); request.ContentType = "text/plain; charset=utf-8"; } }
private static EncryptedValidationToken CreateEncryptedValidationToken(string jsonParamsString, string publicKeyPem) { return(ApiEncryptionValidation.CreateEncryptedValidationToken(jsonParamsString, publicKeyPem)); }