public static ISignatureComposer GetComposer() { if (null == composer) { composer = new RoaSignatureComposer(); } return(composer); }
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); }
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); }
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); }
public static void ClearComposer() { composer = null; }
public static ISignatureComposer GetComposer() { if (null == composer) composer = new RpcSignatureComposer(); return composer; }
public static ISignatureComposer GetComposer() { return(_composer ?? (_composer = new RpcSignatureComposer())); }