[英]Generate Azure Shared Access Signature with out using Azure Storage API
I have seen that SAS can be generated using Storage API. 我已经看到可以使用Storage API生成SAS。
Is there a way to generate it from Management Studio or with out using API? 有没有一种方法可以从Management Studio生成它,也可以不使用API生成它?
You could create a SAS using REST API. 您可以使用REST API创建SAS。 In fact, storage client library is just a wrapper over this REST API.
实际上,存储客户端库只是该REST API的包装。 Here's the link for creating SAS using REST API: http://msdn.microsoft.com/en-us/library/windowsazure/dn140255.aspx .
这是使用REST API创建SAS的链接: http : //msdn.microsoft.com/zh-cn/library/windowsazure/dn140255.aspx 。
This document describes how the SAS should be generated. 本文档介绍了如何生成SAS。 You can use the API / SDK or you can write your own code for it.
您可以使用API / SDK ,也可以为其编写自己的代码。
The string-to-sign is a unique string constructed from the fields that must be verified in order to authenticate the request.
字符串签名是一个唯一的字符串,由必须验证才能验证请求的字段构成。 The signature is an HMAC computed over the string-to-sign and key using the SHA256 algorithm, and then encoded using Base64 encoding.
签名是使用SHA256算法在字符串到符号和密钥上计算的HMAC,然后使用Base64编码进行编码。
For example in the latest version you make the string to sign like this: 例如,在最新版本中,您使字符串像这样签名:
StringToSign = signedpermissions + "\n" +
signedstart + "\n" +
signedexpiry + "\n" +
canonicalizedresource + "\n" +
signedidentifier + "\n" +
signedIP + "\n" +
signedProtocol + "\n" +
signedversion + "\n" +
rscc + "\n" +
rscd + "\n" +
rsce + "\n" +
rscl + "\n" +
rsct
and then you'd compute the hash of that and encode. 然后计算该哈希值并进行编码。
You're much better off using the SDK if possible, else grabbing some existing code that does it instead of writing from scratch. 如果可能的话,您最好使用SDK,否则,请抓住一些现有的实现此功能的代码,而不是从头开始编写。 eg see this question or this , or maybe the SDK code is available so you can just inspect that and take the bits you like.
例如,请参阅此问题或this ,或者SDK代码可用,因此您可以检查一下并取所需的内容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.