This article is a mirror article of machine translation, please click here to jump to the original article.

View: 715|Reply: 0

[Source] .NET/C# Alibaba Cloud includes the V4 signature algorithm in the Header

[Copy link]
Posted on 2025-4-13 18:46:05 | | | |
Requirements: You need to use Alibaba Cloud's OSS object storage, and you need to call the interface to upload and download operations. The official SDK method is provided, however, it feels a bit heavy, and I want to implement it myself, check the documentation and the official SDK code implementation.

Review:

Alibaba Cloud OSS Object Storage Tutorial on Creating a New Bucket and Setting RAM Policy
https://www.itsvse.com/thread-10986-1-1.html

Include the V4 signed document in the Header:The hyperlink login is visible.
.NET/C# official code implementation:The hyperlink login is visible.

Authorization request header

When you make a request to OSS, you need to include a signature in the Authorization header to validate the request.

The Authorization request header format is as follows:


Signature calculation

When OSS receives a request, it calculates the signature and compares it to the signature in the Authorization request header. If it is consistent, the request succeeds; Otherwise, the request fails.

The signature calculation process is shown in the figure below:



The upload using C# is successful as shown below:



The code is as follows:

Download Code:

As shown below:



(End)




Previous:The secp256k1 algorithm behind cryptocurrencies in the blockchain
Next:Blockchain digital wallet (HD) BIP32, BIP44, BIP39 protocol
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com