{"id":535623,"date":"2021-09-18T14:59:59","date_gmt":"2021-09-18T06:59:59","guid":{"rendered":"http:\/\/4563.org\/?p=535623"},"modified":"2021-09-18T14:59:59","modified_gmt":"2021-09-18T06:59:59","slug":"cf%e5%9b%be%e5%ba%8a%e4%bb%a3%e7%a0%81%e9%97%ae%e9%a2%98%e8%af%b7%e6%95%99%ef%bc%8c%e7%ad%be%e5%90%8d","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=535623","title":{"rendered":"cf\u56fe\u5e8a\u4ee3\u7801\u95ee\u9898\u8bf7\u6559\uff0c\u7b7e\u540d"},"content":{"rendered":"\n<p>  \t\t\t\t\t<strong>\u658c\u658c<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3>cf\u56fe\u5e8a\u4ee3\u7801\u95ee\u9898\u8bf7\u6559\uff0c\u7b7e\u540d<\/h3>\n<p>  \t\thttps:\/\/developers.cloudflare.com\/images\/serving-images\/serving-private-images-using-signed-url-tokens<\/p>\n<p>  \u6709\u5927\u4f6c\u6709\u73b0\u6210\u7684C# \u7684\u4e48\u3002<br \/>  \u6216\u4e0b\u9762\u8fd9\u600e\u4e48\u7ffb\u8bd1C#\u7684<br \/>  const encoder = new TextEncoder();<br \/>  const secretKeyData = encoder.encode(KEY);<br \/>  const key = await crypto.subtle.importKey(<br \/>  &nbsp; &nbsp; &quot;raw&quot;,<br \/>  &nbsp; &nbsp; secretKeyData,<br \/>  &nbsp; &nbsp; { name: &quot;HMAC&quot;, hash: &quot;SHA-256&quot; },<br \/>  &nbsp; &nbsp; false,<br \/>  &nbsp; &nbsp; [&quot;sign&quot;]<br \/>  );\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u6ef4\u6ef4\u5355\u8f66<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\thttps:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/system.security.cryptography.hmacsha256\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u658c\u658c<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u6ef4\u6ef4\u5355\u8f66 \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2021-9-18 15:00<br \/>  https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/system.security.cryptography.hmacsha256<\/p>\n<p> sha256 \u4f1a\u4e86\uff0c\u4e3b\u8981\u6ca1\u770b\u61c2\u4ed6\u8fd9\u4e2a\u903b\u8f91\u3002<br \/>  \u8fd9\u662f\u5565\u8bed\u8a00\u7684\u4ee3\u7801\uff0cnodejs\u4e48\u3002<br \/>  const encoder = new TextEncoder();<br \/>  const secretKeyData = encoder.encode(KEY);<br \/>  \u6bd4\u5982\u4e0d\u660e\u767dencoder.encode \u662furl \u7f16\u7801\u4e48\uff1f<br \/>  url.searchParams.set \u662f\u505a\u4ec0\u4e48\u7684\u6ca1\u660e\u767d\u3002\t\t\t  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u658c\u658c \u5927\u4f6c\u6709\u8bdd\u8bf4 : cf\u56fe\u5e8a\u4ee3\u7801&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/535623"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=535623"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/535623\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=535623"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=535623"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=535623"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}