ExAwsSnsVerifier.Canonical (ex_aws_sns_verifier v0.1.0)

Copy Markdown View Source

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).

Summary

Functions

Build the canonical string to be used for signature verification.

Functions

build(message)

@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.