# `ExAwsSnsVerifier.Canonical`
[🔗](https://github.com/GustavoZiaugra/ex_aws_sns_verifier/blob/v0.1.0/lib/ex_aws_sns_verifier/canonical.ex#L1)

Construct the canonical string for SNS message signature verification.

Per AWS documentation, the canonical string is built from specific message
fields joined with newlines. The exact fields depend on the message type
(Notification vs SubscriptionConfirmation/UnsubscribeConfirmation).

# `build`

```elixir
@spec build(map()) :: {:ok, String.t()} | {:error, atom()}
```

Build the canonical string to be used for signature verification.

The returned string must have a trailing newline appended before being passed
to `:public_key.verify/4`.

---

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