{"id":13804,"date":"2022-12-01T10:39:45","date_gmt":"2022-12-01T02:39:45","guid":{"rendered":"https:\/\/www.yimenapp.com\/kb-yimen\/?p=13804"},"modified":"2022-12-01T10:39:45","modified_gmt":"2022-12-01T02:39:45","slug":"%e6%94%af%e4%bb%98%e5%ae%9d%e6%9c%8d%e5%8a%a1%e7%ab%af%e5%a6%82%e4%bd%95%e6%8e%a5%e6%94%b6%e9%80%9a%e7%9f%a5%e5%8f%8a%e9%aa%8c%e7%ad%be%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/www.yimenapp.com\/kb-yimen\/13804\/","title":{"rendered":"\u652f\u4ed8\u5b9d\u670d\u52a1\u7aef\u5982\u4f55\u63a5\u6536\u901a\u77e5\u53ca\u9a8c\u7b7e\uff1f"},"content":{"rendered":"\n<p><span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/%e6%94%af%e4%bb%98%e5%ae%9d\/\" title=\"\u652f\u4ed8\u5b9d\" target=\"_blank\">\u652f\u4ed8\u5b9d<\/a><\/span><span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/%e6%9c%8d%e5%8a%a1%e7%ab%af\/\" title=\"\u670d\u52a1\u7aef\" target=\"_blank\">\u670d\u52a1\u7aef<\/a><\/span>\u5982\u4f55\u63a5\u6536\u901a\u77e5\u53ca<span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/%e9%aa%8c%e7%ad%be\/\" title=\"\u9a8c\u7b7e\" target=\"_blank\">\u9a8c\u7b7e<\/a><\/span>\uff1f<\/p>\n\n\n\n<p>\u4ee5\u652f\u4ed8\u63a5\u53e3\u63a5\u6536\u901a\u77e5\u5e76\u5904\u7406\u4e3a\u4f8b\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"HXNRt\">Java \u8c03\u7528\u793a\u4f8b<\/h4>\n\n\n\n<p><strong>Java \u5f02\u6b65\u9a8c\u7b7e\u793a\u4f8b<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/\u83b7\u53d6\u652f\u4ed8\u5b9dPOST\u8fc7\u6765\u53cd\u9988\u4fe1\u606f \n    Map&lt; String , String &gt; params = new HashMap &lt; String , String &gt; ();\n    Map requestParams = request.getParameterMap();\n    for(Iterator iter = requestParams.keySet().iterator();iter.hasNext();){\n   String name = (String)iter.next();\n   String[] values = (String [])requestParams.get(name);\n   String valueStr = \"\";\n   for(int i = 0;i &lt; values.length;i ++ ){\n    valueStr =  (i==values.length-1)?valueStr + values [i]:valueStr + values[i] + \",\";\n   }\n   \/\/\u4e71\u7801\u89e3\u51b3\uff0c\u8fd9\u6bb5\u4ee3\u7801\u5728\u51fa\u73b0\u4e71\u7801\u65f6\u4f7f\u7528\u3002 \n   \/\/valueStr = new String(valueStr.getBytes(\"ISO-8859-1\"), \"utf-8\"); \n   params.put (name,valueStr);\n    }\n    \/\/\u5207\u8bb0alipaypublickey\u662f\u652f\u4ed8\u5b9d\u7684\u516c\u94a5\uff0c\u8bf7\u53bbopen.alipay.com\u5bf9\u5e94\u5e94\u7528\u4e0b\u67e5\u770b\u3002 \n    \/\/boolean AlipaySignature.rsaCheckV1(Map&lt;String, String&gt; params, String publicKey, String charset, String sign_type) \n    boolean flag = AlipaySignature.rsaCheckV1 (params,alipaypublicKey, \"UTF-8\",\"RSA2\");<\/pre>\n\n\n\n<p><strong>Java\u5f02\u6b65\u9a8c\u7b7e\u793a\u4f8b\uff08\u8bc1\u4e66\uff09<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/\u83b7\u53d6\u652f\u4ed8\u5b9dPOST\u8fc7\u6765\u53cd\u9988\u4fe1\u606f \n   Map&lt;String,String&gt; params = new HashMap&lt;String,String&gt;();\n   Map requestParams = request.getParameterMap();\n   for (Iterator iter = requestParams.keySet().iterator(); iter.hasNext ();) {\n    String name =  ( String )iter.next();\n    String[] values = (String[])requestParams.get(name);\n    String valueStr=\"\";\n    for(int i = 0;i &lt; values.length; i++){\n    valueStr = (i== values.length-1)?valueStr+values[i]:valueStr+values[i] + \",\";\n    }\n   \/\/\u4e71\u7801\u89e3\u51b3\uff0c\u8fd9\u6bb5\u4ee3\u7801\u5728\u51fa\u73b0\u4e71\u7801\u65f6\u4f7f\u7528\u3002 \n   \/\/valueStr = new String(valueStr.getBytes(\"ISO-8859-1\"), \"utf-8\"); \n   params.put(name,valueStr);\n    }\n   \/\/\u5207\u8bb0alipayPublicCertPath\u662f\u652f\u4ed8\u5b9d\u516c\u94a5\u8bc1\u4e66\u8def\u5f84\uff0c\u8bf7\u53bbopen.alipay.com\u5bf9\u5e94\u5e94\u7528\u4e0b\u8f7d\u3002 \n   \/\/boolean AlipaySignature.rsaCertCheckV1(Map&lt;String, String&gt; params, String publicKeyCertPath, String charset,String signType) \n   boolean flag = AlipaySignature.rsaCertCheckV1(params,alipayPublicCertPath,\"UTF-8\",\"RSA2\");<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"N0mmN\">PHP \u8c03\u7528\u793a\u4f8b<\/h4>\n\n\n\n<p><strong>PHP\u5f02\u6b65\u9a8c\u7b7e\u793a\u4f8b<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">php\u8bed\u8a00\u516c\u94a5\u4e0e\u516c\u94a5\u8bc1\u4e66\u9a8c\u7b7e\u65b9\u6cd5\u76f8\u540c\u3002\n$aop = new AopClient;\n$aop-&gt;alipayrsaPublicKey = '\u8bf7\u586b\u5199\u652f\u4ed8\u5b9d\u516c\u94a5\/\u652f\u4ed8\u5b9d\u516c\u94a5\u8bc1\u4e66\u8def\u5f84';\n$flag = $aop-&gt;rsaCheckV1($_POST, NULL, \"RSA2\");<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"NScJQ\">C#\u8c03\u7528\u793a\u4f8b<\/h4>\n\n\n\n<p><strong>C#\u5f02\u6b65\u9a8c\u7b7e\u793a\u4f8b<\/strong><\/p>\n\n\n\n<p>\u9a8c\u7b7e\u65b9\u6cd5\u4e2d keyFromFile \u5fc5\u4f20 false\uff0c\u5426\u5219\u9a8c\u7b7e\u5931\u8d25\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ \u83b7 \u53d6 \u652f \u4ed8 \u5b9d POST \u8fc7 \u6765 \u901a \u77e5 \u6d88 \u606f \uff0c \u5e76 \u4ee5 \u201c\u53c2 \u6570 \u540d = \u53c2 \u6570 \u503c \u201d \u7684 \u5f62 \u5f0f \u7ec4 \u6210 \u6570 \u7ec4 \n \/\/ request \u56de \u6765 \u7684 \u4fe1 \u606f \u7ec4 \u6210 \u7684 \u6570 \u7ec4 \n  public Dictionary&lt;string,string&gt; GetRequestPost()\n {\n    int  i = 0 ;\n    IDictionary&lt;string,string&gt; sArray = new IDictionary&lt;string,string&gt;();\n    NameValueCollection coll;\n    \/\/ Load  Form  variables  into  NameValueCollection  variable . \n    coll = Request.Form ;\n    \/\/Get names of all forms into a string array . \n    String[] requestItem = coll.AllKeys;\n    for (i = 0;i &lt; requestItem.Length ; i++)\n   {\n      sArray.Add( requestItem[i], Request.Form[requestItem[i]]);\n    }\n    return sArray ;\n }\n  \/\/ \u5207 \u8bb0 alipaypublickey \u662f \u652f \u4ed8 \u5b9d \u7684 \u516c \u94a5 \uff0c \u8bf7 \u53bb open .alipay .com \u5bf9 \u5e94 \u5e94 \u7528 \u4e0b \u67e5 \u770b \u3002 \n  \/\/ bool  RSACheckV1 ( IDictionary &lt; string , string &gt;  parameters , string  alipaypublicKey , string  charset , string  signType , bool  keyFromFile )\n  bool flag = AlipaySignature.RSACheckV1(GetRequestPost(),alipaypublicKey,\"UTF-8\",\"RSA2\",false);<\/pre>\n\n\n\n<p><strong>C#\u5f02\u6b65\u9a8c\u7b7e\u793a\u4f8b\uff08\u8bc1\u4e66\uff09<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ \u83b7 \u53d6 \u652f \u4ed8 \u5b9d POST \u8fc7 \u6765 \u901a \u77e5 \u6d88 \u606f \uff0c \u5e76 \u4ee5 \u201c\u53c2 \u6570 \u540d = \u53c2 \u6570 \u503c \u201d \u7684 \u5f62 \u5f0f \u7ec4 \u6210 \u6570 \u7ec4 \n    \/\/ request \u56de \u6765 \u7684 \u4fe1 \u606f \u7ec4 \u6210 \u7684 \u6570 \u7ec4 \n     public Dictionary&lt;string,string&gt; GetRequestPost()\n    {\n       int  i = 0 ;\n       IDictionary&lt;string,string&gt; sArray = new IDictionary&lt;string,string&gt;();\n       NameValueCollection coll;\n       \/\/ Load  Form  variables  into  NameValueCollection  variable . \n       coll = Request.Form ;\n       \/\/Get names of all forms into a string array . \n       String[] requestItem = coll.AllKeys;\n       for (i = 0;i &lt; requestItem.Length ; i++)\n      {\n         sArray.Add( requestItem[i], Request.Form[requestItem[i]]);\n       }\n       return sArray ;\n    }\n     \/\/ \u5207 \u8bb0 alipayPublicCertPath \u662f \u652f\u4ed8\u5b9d\u516c\u94a5\u8bc1\u4e66\u8def\u5f84 \uff0c \u8bf7 \u53bb open .alipay .com \u5bf9 \u5e94 \u5e94 \u7528 \u4e0b \u67e5 \u770b \u3002 \n     \/\/ bool  RSACheckV1 ( IDictionary &lt; string , string &gt;  parameters , string  alipayPublicCertPath , string  charset , string  signType)\n  bool flag = AlipaySignature.RSACertCheckV1(dics, alipayPublicCertPath, \"UTF-8\", \"RSA2\");<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u652f\u4ed8\u5b9d\u670d\u52a1\u7aef\u5982\u4f55\u63a5\u6536\u901a\u77e5\u53ca\u9a8c\u7b7e\uff1f<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[45],"tags":[3236,5202,6437],"special":[72],"attr":[],"class_list":["post-13804","post","type-post","status-publish","format-standard","hentry","category-kaifangpingtai","tag-3236","tag-5202","tag-6437","special-zfbopen","entry"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts\/13804","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/comments?post=13804"}],"version-history":[{"count":1,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts\/13804\/revisions"}],"predecessor-version":[{"id":13805,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts\/13804\/revisions\/13805"}],"wp:attachment":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/media?parent=13804"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/categories?post=13804"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/tags?post=13804"},{"taxonomy":"special","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/special?post=13804"},{"taxonomy":"attr","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/attr?post=13804"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}