示例#1
0
        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";
            }
        }
示例#2
0
 private static EncryptedValidationToken CreateEncryptedValidationToken(string jsonParamsString, string publicKeyPem)
 {
     return(ApiEncryptionValidation.CreateEncryptedValidationToken(jsonParamsString, publicKeyPem));
 }