{
  "schema_version": "1.1.0",
  "record_type": "citation-evidence-pack",
  "pack_id": "aws-signature-v4-calculator",
  "title": "AWS SigV4 canonical request examples",
  "description": "Reproduce three published AWS S3 signatures and compare the canonical request, its SHA-256 hash, and the string to sign.",
  "scope": "These historical examples use AWS's public sample credentials. They check signature calculation locally; AWS separately checks credential validity, request time, and permissions.",
  "canonical_url": "https://encrypt-online.com/evidence/aws-signature-v4-calculator.json",
  "tool": {
    "id": "aws-signature-v4-calculator",
    "name": "AWS Signature V4 Calculator",
    "path": "/tools/aws-signature-v4-calculator",
    "canonical_url": "https://encrypt-online.com/tools/aws-signature-v4-calculator"
  },
  "implementation": {
    "version": "source-sha256:c607eae36380eb28",
    "aggregate_sha256": "c607eae36380eb280fea0f320f906932d5e528c4acee86b56a0b4ac6ecfc6ef2",
    "sources": [
      {
        "path": "package-lock.json",
        "sha256": "fb25cd404f41ef1f4e0d22bbb4cd7b0ff858db7700351dfd27d79138d8661f58"
      },
      {
        "path": "lib/aws-sigv4-core.mjs",
        "sha256": "cd9110f0a2c530fd98285901236a884411787d23d21a63206472efaf21fdd146"
      },
      {
        "path": "data/aws-citation-evidence.mjs",
        "sha256": "2440346949657d772a9fc2b08d263a6bfc94114c211f51da2d6bd21625006c98"
      },
      {
        "path": "scripts/aws-citation-evidence-adapters.mjs",
        "sha256": "a3f9673ebb53001c058dbc73d8afdb2b841158494772cff112832390d55de20d"
      },
      {
        "path": "scripts/check-aws-citation-evidence.mjs",
        "sha256": "29eef53beed7767630db0b5c74f13113676db82902f93a78c97438469d8104cb"
      }
    ]
  },
  "verification": {
    "last_verified": "2026-10-20",
    "command": "npm run check:citation-evidence",
    "environments": [
      "Node.js release check with Web Crypto",
      "Chromium desktop 1440x900 evidence presentation"
    ]
  },
  "standards": [
    {
      "name": "AWS S3 SigV4 header authentication",
      "section": "Canonical request and published GET Object, PUT Object, and List Objects examples",
      "url": "https://docs.aws.amazon.com/AmazonS3/latest/developerguide/sig-v4-header-based-auth.html"
    },
    {
      "name": "AWS SigV4 troubleshooting",
      "section": "Canonical request and signing string errors",
      "url": "https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv-troubleshooting.html"
    }
  ],
  "cases": [
    {
      "case_id": "AWS-SIGV4-GET-OBJECT-001",
      "classification": "valid",
      "symptom": "Reproduce AWS's published GET Object signature with an empty body and a signed Range header.",
      "safe_input": {
        "method": "GET",
        "service": "s3",
        "region": "us-east-1",
        "amzDate": "20130524T000000Z",
        "payload": "",
        "payloadMode": "hash",
        "accessKey": "AKIAIOSFODNN7EXAMPLE",
        "secretKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
        "url": "https://examplebucket.s3.amazonaws.com/test.txt",
        "headers": "Range: bytes=0-9"
      },
      "expected_output": {
        "status": "calculated",
        "canonical_uri": "/test.txt",
        "canonical_query": "",
        "payload_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
        "signed_headers": "host;range;x-amz-content-sha256;x-amz-date",
        "canonical_request": "GET\n/test.txt\n\nhost:examplebucket.s3.amazonaws.com\nrange:bytes=0-9\nx-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\nx-amz-date:20130524T000000Z\n\nhost;range;x-amz-content-sha256;x-amz-date\ne3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
        "canonical_request_sha256": "7344ae5b7ee6c3e7e6b0fe0640412a37625d1fbfff95c48bbb2dc43964946972",
        "string_to_sign": "AWS4-HMAC-SHA256\n20130524T000000Z\n20130524/us-east-1/s3/aws4_request\n7344ae5b7ee6c3e7e6b0fe0640412a37625d1fbfff95c48bbb2dc43964946972",
        "signature": "f0e8bdb87c964420e857bd35b5d6ed310bd44f0170aba48dd91039c6036bdb41"
      },
      "failure_code": null,
      "expected_outcome": "The canonical request hash and signature match AWS's published GET example. Keep the blank query line and the blank line after canonical headers.",
      "fixture_sha256": "69b38c74538cc66b15b531a0ea7b749c955e78dcb68545fb9b8a71664776533b",
      "example": {
        "title": "AWS GET Object reference",
        "steps": [
          "Select Load AWS example in the calculator. It fills this request and the public example credentials.",
          "Keep the signing time at 20130524T000000Z, the body empty, and Payload signing set to SHA-256 of this body.",
          "Select Calculate signature, then compare the canonical request, hash in the string to sign, and signature below."
        ],
        "values": [
          {
            "label": "Request URL",
            "value": "https://examplebucket.s3.amazonaws.com/test.txt"
          },
          {
            "label": "Signed request header",
            "value": "Range: bytes=0-9"
          },
          {
            "label": "Signing time",
            "value": "20130524T000000Z"
          },
          {
            "label": "Canonical request",
            "value": "GET\n/test.txt\n\nhost:examplebucket.s3.amazonaws.com\nrange:bytes=0-9\nx-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\nx-amz-date:20130524T000000Z\n\nhost;range;x-amz-content-sha256;x-amz-date\ne3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
          },
          {
            "label": "Canonical request SHA-256",
            "value": "7344ae5b7ee6c3e7e6b0fe0640412a37625d1fbfff95c48bbb2dc43964946972"
          },
          {
            "label": "String to sign",
            "value": "AWS4-HMAC-SHA256\n20130524T000000Z\n20130524/us-east-1/s3/aws4_request\n7344ae5b7ee6c3e7e6b0fe0640412a37625d1fbfff95c48bbb2dc43964946972"
          },
          {
            "label": "Expected signature",
            "value": "f0e8bdb87c964420e857bd35b5d6ed310bd44f0170aba48dd91039c6036bdb41"
          }
        ]
      }
    },
    {
      "case_id": "AWS-SIGV4-PUT-OBJECT-002",
      "classification": "valid",
      "symptom": "Reproduce AWS's PUT Object signature for a dollar sign in the object path and a nonempty request body.",
      "safe_input": {
        "method": "PUT",
        "service": "s3",
        "region": "us-east-1",
        "amzDate": "20130524T000000Z",
        "payload": "Welcome to Amazon S3.",
        "payloadMode": "hash",
        "accessKey": "AKIAIOSFODNN7EXAMPLE",
        "secretKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
        "url": "https://examplebucket.s3.amazonaws.com/test$file.text",
        "headers": "Date: Fri, 24 May 2013 00:00:00 GMT\nx-amz-storage-class: REDUCED_REDUNDANCY"
      },
      "expected_output": {
        "status": "calculated",
        "canonical_uri": "/test%24file.text",
        "canonical_query": "",
        "payload_hash": "44ce7dd67c959e0d3524ffac1771dfbba87d2b6b4b4e99e42034a8b803f8b072",
        "signed_headers": "date;host;x-amz-content-sha256;x-amz-date;x-amz-storage-class",
        "canonical_request": "PUT\n/test%24file.text\n\ndate:Fri, 24 May 2013 00:00:00 GMT\nhost:examplebucket.s3.amazonaws.com\nx-amz-content-sha256:44ce7dd67c959e0d3524ffac1771dfbba87d2b6b4b4e99e42034a8b803f8b072\nx-amz-date:20130524T000000Z\nx-amz-storage-class:REDUCED_REDUNDANCY\n\ndate;host;x-amz-content-sha256;x-amz-date;x-amz-storage-class\n44ce7dd67c959e0d3524ffac1771dfbba87d2b6b4b4e99e42034a8b803f8b072",
        "canonical_request_sha256": "9e0e90d9c76de8fa5b200d8c849cd5b8dc7a3be3951ddb7f6a76b4158342019d",
        "string_to_sign": "AWS4-HMAC-SHA256\n20130524T000000Z\n20130524/us-east-1/s3/aws4_request\n9e0e90d9c76de8fa5b200d8c849cd5b8dc7a3be3951ddb7f6a76b4158342019d",
        "signature": "98ad721746da40c64f1a55b78f14c238d841ea1380cd77a1b5971af0ece108bd"
      },
      "failure_code": null,
      "expected_outcome": "The dollar sign becomes %24 in the canonical URI, and the exact body produces the published payload hash and PUT signature.",
      "fixture_sha256": "216de465bd180d004c0444719d3a773d055c68e7ee233cda5dc66b3160441668",
      "example": {
        "title": "PUT with a dollar sign in the path",
        "steps": [
          "Paste the request URL below, choose PUT, and set Service to s3 and Region to us-east-1.",
          "Open Request body, headers, and signing time. Paste the header lines and exact body without a final newline, choose SHA-256 of this body, and set Signing time to 20130524T000000Z.",
          "Open Sign with credentials. Enter access key ID AKIAIOSFODNN7EXAMPLE and the public example secret below. Leave Session token and Signature to compare empty.",
          "Select Calculate signature and compare the canonical path, body hash, and signature."
        ],
        "values": [
          {
            "label": "Request URL",
            "value": "https://examplebucket.s3.amazonaws.com/test$file.text"
          },
          {
            "label": "Headers included in the signature",
            "value": "Date: Fri, 24 May 2013 00:00:00 GMT\nx-amz-storage-class: REDUCED_REDUNDANCY"
          },
          {
            "label": "Exact request body",
            "value": "Welcome to Amazon S3."
          },
          {
            "label": "Public AWS example secret",
            "value": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
          },
          {
            "label": "Canonical request",
            "value": "PUT\n/test%24file.text\n\ndate:Fri, 24 May 2013 00:00:00 GMT\nhost:examplebucket.s3.amazonaws.com\nx-amz-content-sha256:44ce7dd67c959e0d3524ffac1771dfbba87d2b6b4b4e99e42034a8b803f8b072\nx-amz-date:20130524T000000Z\nx-amz-storage-class:REDUCED_REDUNDANCY\n\ndate;host;x-amz-content-sha256;x-amz-date;x-amz-storage-class\n44ce7dd67c959e0d3524ffac1771dfbba87d2b6b4b4e99e42034a8b803f8b072"
          },
          {
            "label": "Canonical request SHA-256",
            "value": "9e0e90d9c76de8fa5b200d8c849cd5b8dc7a3be3951ddb7f6a76b4158342019d"
          },
          {
            "label": "String to sign",
            "value": "AWS4-HMAC-SHA256\n20130524T000000Z\n20130524/us-east-1/s3/aws4_request\n9e0e90d9c76de8fa5b200d8c849cd5b8dc7a3be3951ddb7f6a76b4158342019d"
          },
          {
            "label": "Expected signature",
            "value": "98ad721746da40c64f1a55b78f14c238d841ea1380cd77a1b5971af0ece108bd"
          }
        ]
      }
    },
    {
      "case_id": "AWS-SIGV4-QUERY-ORDER-003",
      "classification": "valid",
      "symptom": "Query parameters supplied in reverse order still reproduce AWS's published List Objects signature.",
      "safe_input": {
        "method": "GET",
        "service": "s3",
        "region": "us-east-1",
        "amzDate": "20130524T000000Z",
        "payload": "",
        "payloadMode": "hash",
        "accessKey": "AKIAIOSFODNN7EXAMPLE",
        "secretKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
        "url": "https://examplebucket.s3.amazonaws.com/?prefix=J&max-keys=2",
        "headers": ""
      },
      "expected_output": {
        "status": "calculated",
        "canonical_uri": "/",
        "canonical_query": "max-keys=2&prefix=J",
        "payload_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
        "signed_headers": "host;x-amz-content-sha256;x-amz-date",
        "canonical_request": "GET\n/\nmax-keys=2&prefix=J\nhost:examplebucket.s3.amazonaws.com\nx-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\nx-amz-date:20130524T000000Z\n\nhost;x-amz-content-sha256;x-amz-date\ne3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
        "canonical_request_sha256": "df57d21db20da04d7fa30298dd4488ba3a2b47ca3a489c74750e0f1e7df1b9b7",
        "string_to_sign": "AWS4-HMAC-SHA256\n20130524T000000Z\n20130524/us-east-1/s3/aws4_request\ndf57d21db20da04d7fa30298dd4488ba3a2b47ca3a489c74750e0f1e7df1b9b7",
        "signature": "34b48302e7b5fa45bde8084f4b7868a86f0a534bc59db6670ed5711ef69dc6f7"
      },
      "failure_code": null,
      "expected_outcome": "The canonical query sorts max-keys before prefix. Reordering the same query values preserves the published signature.",
      "fixture_sha256": "4417a0400a7fdc24b65dc43956040be116a32d4ab79d0b22ba15597742fe8852",
      "example": {
        "title": "Query parameter order",
        "steps": [
          "Paste the request URL below, choose GET, and set Service to s3 and Region to us-east-1.",
          "Open Request body, headers, and signing time. Leave headers and body empty, choose SHA-256 of this body, and set Signing time to 20130524T000000Z.",
          "Open Sign with credentials. Enter access key ID AKIAIOSFODNN7EXAMPLE and the public example secret below. Leave Session token and Signature to compare empty.",
          "Select Calculate signature. The canonical query sorts the parameters and reproduces AWS's published List Objects signature."
        ],
        "values": [
          {
            "label": "Request URL with reversed query order",
            "value": "https://examplebucket.s3.amazonaws.com/?prefix=J&max-keys=2"
          },
          {
            "label": "Public AWS example secret",
            "value": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
          },
          {
            "label": "Canonical query",
            "value": "max-keys=2&prefix=J"
          },
          {
            "label": "Canonical request",
            "value": "GET\n/\nmax-keys=2&prefix=J\nhost:examplebucket.s3.amazonaws.com\nx-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\nx-amz-date:20130524T000000Z\n\nhost;x-amz-content-sha256;x-amz-date\ne3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
          },
          {
            "label": "Canonical request SHA-256",
            "value": "df57d21db20da04d7fa30298dd4488ba3a2b47ca3a489c74750e0f1e7df1b9b7"
          },
          {
            "label": "String to sign",
            "value": "AWS4-HMAC-SHA256\n20130524T000000Z\n20130524/us-east-1/s3/aws4_request\ndf57d21db20da04d7fa30298dd4488ba3a2b47ca3a489c74750e0f1e7df1b9b7"
          },
          {
            "label": "Expected signature",
            "value": "34b48302e7b5fa45bde8084f4b7868a86f0a534bc59db6670ed5711ef69dc6f7"
          }
        ]
      }
    }
  ]
}
