Esempio n. 1
0
        public Dictionary <string, string> RefreshSignParameters(Dictionary <String, String> parameters,
                                                                 Signer signer, String accessKeyId, FormatType?format)
        {
            Dictionary <string, string> immutableMap = new Dictionary <string, string>(parameters);

            DictionaryUtil.Add(immutableMap, "Date", ParameterHelper.GetRFC2616Date(DateTime.Now));
            if (null == format)
            {
                format = FormatType.RAW;
            }
            DictionaryUtil.Add(immutableMap, "Accept", ParameterHelper.FormatTypeToString(format));
            DictionaryUtil.Add(immutableMap, "x-acs-signature-method", signer.GetSignerName());
            DictionaryUtil.Add(immutableMap, "x-acs-signature-version", signer.GetSignerVersion());
            if (signer.GetSignerType() != null)
            {
                DictionaryUtil.Add(immutableMap, "x-acs-signature-type", signer.GetSignerType());
            }
            return(immutableMap);
        }
Esempio n. 2
0
        public Dictionary <String, String> RefreshSignParameters(Dictionary <String, String> parameters,
                                                                 Signer signer, String accessKeyId, FormatType?format)
        {
            Dictionary <String, String> immutableMap = new Dictionary <String, String>(parameters);

            DictionaryUtil.Add(immutableMap, "Timestamp", ParameterHelper.FormatIso8601Date(DateTime.Now));
            DictionaryUtil.Add(immutableMap, "SignatureMethod", signer.GetSignerName());
            DictionaryUtil.Add(immutableMap, "SignatureVersion", signer.GetSignerVersion());
            DictionaryUtil.Add(immutableMap, "SignatureNonce", Guid.NewGuid().ToString());
            DictionaryUtil.Add(immutableMap, "AccessKeyId", accessKeyId);
            if (null != format)
            {
                DictionaryUtil.Add(immutableMap, "Format", format.ToString());
            }
            if (signer.GetSignerType() != null)
            {
                DictionaryUtil.Add(immutableMap, "SignatureType", signer.GetSignerType());
            }
            return(immutableMap);
        }