AwsSignature 1.1.3
dotnet add package AwsSignature --version 1.1.3
NuGet\Install-Package AwsSignature -Version 1.1.3
<PackageReference Include="AwsSignature" Version="1.1.3" />
<PackageVersion Include="AwsSignature" Version="1.1.3" />
<PackageReference Include="AwsSignature" />
paket add AwsSignature --version 1.1.3
#r "nuget: AwsSignature, 1.1.3"
#addin nuget:?package=AwsSignature&version=1.1.3
#tool nuget:?package=AwsSignature&version=1.1.3
AwsSignature
Library for easy creation of AWS signature
How to use AwsSignature library
Use method with parameters. This function will return a dictionary of headers required to be added to the request.
using AwsSignature;
Dictionary<string, string> headers = AwsSignautureV4.ComputeSignature(new Uri("https://bucket.s3.amazonaws.com/photo1.jpg",
HttpMethod.Get, "s3", "ACCESS_KEY", "SECRET_KEY");
What parameters are used in the method:
Parameter | Type | Description | Default |
---|---|---|---|
uri |
Uri |
Full request URI (e.g., https://bucket.s3.amazonaws.com/photo1.jpg ) |
Required |
httpMethod |
HttpMethod |
HTTP method (HttpMethod.Get , HttpMethod.Post , HttpMethod.Put , etc.) |
Required |
service |
string |
Target service identifier (e.g., s3 , ec2 ) |
Required |
accessKey |
string |
AWS access key | Required |
secretKey |
string |
AWS secret key | Required |
region |
string |
AWS-like region identifier | "default" |
headers |
Dictionary<string, string> |
Additional headers to include in the signature | empty dictionary |
bodyHash |
string |
SHA-256 hash of the request body | EMPTY_BODY_SHA256 |
unsignedPayload |
bool |
Skip payload signing | false |
You can also use the method with a request:
using AwsSignature;
Dictionary<string, string> headers = AwsSignautureV4.ComputeSignature(
new ComputeSignatureV4Request
{
Uri = new Uri("https://bucket.s3.amazonaws.com/photo1.jpg"),
HttpMethod = HttpMethod.Get,
Service = "s3",
AwsAccessKey = "ACCESS_KEY",
AwsSecretKey = "SECRET_KEY",
Region = "default",
Headers = new Dictionary<string, string>(),
BodyHash = AwsSignautureV4.EMPTY_BODY_SHA256,
UnsignedPayload = false
});
What parameters does ComputeSignatureV4Request have:
Parameter | Type | Description | Default |
---|---|---|---|
Uri |
Uri |
Full request URI (e.g., https://bucket.s3.amazonaws.com/photo1.jpg ) |
Required |
HttpMethod |
HttpMethod |
HTTP method (HttpMethod.Get , HttpMethod.Post , HttpMethod.Put , etc.) |
Required |
Service |
string |
Target service identifier (e.g., s3 , ec2 ) |
Required |
AccessKey |
string |
AWS access key | Required |
SecretKey |
string |
AWS secret key | Required |
Region |
string |
AWS-like region identifier | "default" |
Headers |
Dictionary<string, string> |
Additional headers to include in the signature | empty dictionary |
BodyHash |
string |
SHA-256 hash of the request body | EMPTY_BODY_SHA256 |
UnsignedPayload |
bool |
Skip payload signing | false |
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Remake library structure
Update 1.1.1: Fixed a bug with an incorrect signature for urls containing ':' in query params. Slightly changed the structure of the library
Update 1.1.2: Make constants in AwsSignatureV4.cs public
Update 1.1.3: Add param to enable documentation in nuget package