コード例 #1
0
 public static ISignatureComposer GetComposer()
 {
     if (null == composer)
     {
         composer = new RoaSignatureComposer();
     }
     return(composer);
 }
コード例 #2
0
 public void RefreshSignParameters()
 {
     Dictionary <string, string> tmp = new Dictionary <string, string>
     {
         { "foo", "bar" },
         { "a", "A" },
         { "b", "B" }
     };
     Signer                      signer     = new HmacSHA1Signer();
     FormatType                  formatType = FormatType.JSON;
     ISignatureComposer          instance   = RoaSignatureComposer.GetComposer();
     Dictionary <String, String> result     = instance.RefreshSignParameters(tmp, signer, "accessKeyId", formatType);
 }
コード例 #3
0
        public void ComposeStringToSign()
        {
            Dictionary <string, string> tmp = new Dictionary <string, string>
            {
                { "foo", "bar" },
                { "a", "A" },
                { "b", "B" }
            };
            MethodType         method   = MethodType.GET;
            Signer             signer   = new HmacSHA1Signer();
            ISignatureComposer instance = RoaSignatureComposer.GetComposer();
            string             result   = instance.ComposeStringToSign(method, "uriPattern", signer, tmp, tmp, tmp);

            Assert.Equal("GET\n\n\n\n\nuriPattern?a=A&b=B&foo=bar", result);
        }
コード例 #4
0
        public void ComposeStringToSign()
        {
            RoaSignatureComposer.ClearComposer();
            Dictionary <string, string> tmp = new Dictionary <string, string>
            {
                { "foo", "bar" },
                { "a", "A" },
                { "nullValue", null }
            };
            MethodType         method   = MethodType.GET;
            Signer             signer   = new HmacSHA1Signer();
            ISignatureComposer instance = RoaSignatureComposer.GetComposer();
            string             result   = instance.ComposeStringToSign(method, "www.alibabacloud.com?", signer, tmp, tmp, tmp);

            Assert.Equal("GET\n\n\n\n\nwww.alibabacloud.com?&a=A&foo=bar&nullValue", result);
        }
コード例 #5
0
 public static void ClearComposer()
 {
     composer = null;
 }
コード例 #6
0
 public static ISignatureComposer GetComposer()
 {
     if (null == composer)
         composer = new RpcSignatureComposer();
     return composer;
 }
コード例 #7
0
 public static ISignatureComposer GetComposer()
 {
     return(_composer ?? (_composer = new RpcSignatureComposer()));
 }