# `ExStorageServiceSdk.SigV4`
[🔗](https://github.com/gsmlg-opt/ex_storage_service/blob/v0.7.1/lib/ex_storage_service_sdk/sigv4.ex#L1)

AWS Signature V4 client-side request signing.

Signs outgoing HTTP requests with the standard AWS SigV4 algorithm.
This is the client-side counterpart to the server's SigV4 verification.

# `presign_url`

```elixir
@spec presign_url(String.t(), String.t(), keyword()) :: String.t()
```

Generates a presigned URL for the given parameters.

## Parameters

  * `method` - HTTP method
  * `url` - Base URL, including any existing query pairs
  * `opts` - Options:
    * `:access_key_id` - required
    * `:secret_access_key` - required
    * `:region` - default "us-east-1"
    * `:expires` - seconds until expiry (default 3600)
    * `:now` - override time for testing
    * `:session_token` - Temporary credential token

# `sign_headers`

```elixir
@spec sign_headers(
  String.t(),
  String.t(),
  [{String.t(), String.t()}],
  binary(),
  keyword()
) :: [
  {String.t(), String.t()}
]
```

Signs an HTTP request and returns the headers to add.

## Parameters

  * `method` - HTTP method (e.g., "GET", "PUT")
  * `url` - Full URL string
  * `headers` - Existing headers as a keyword list or map
  * `body` - Request body (binary or "" for GET)
  * `opts` - Options:
    * `:access_key_id` - AWS access key ID (required)
    * `:secret_access_key` - AWS secret access key (required)
    * `:region` - AWS region (default: "us-east-1")
    * `:service` - AWS service name (default: "s3")
    * `:now` - Override current time (for testing)
    * `:payload_hash` - Precomputed SHA256 hex or `UNSIGNED-PAYLOAD` for streamed bodies
    * `:session_token` - Temporary credential token

## Returns

  A list of header tuples to merge into the request.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
