# `Tipalti.SOAP.Signature`
[🔗](https://github.com/iamkanishka/tipalti/blob/main/lib/tipalti/soap/signature.ex#L1)

Implements Tipalti's SOAP API request signing scheme.

Per Tipalti's published authentication process, every SOAP call carries
a signature (`hmac`/`hashkey`) computed as:

  1. Build an authentication string from, in order: the payer name, the
     payee ID (`idap`, payee-function calls only), the current Unix
     timestamp (UTC), and the operation's EAT (Encryption Additional
     Terms) parameter, if that operation defines one.
  2. UTF-8 encode that string.
  3. HMAC-SHA256 the encoded string using the private API key, hex-encoded.

This module has no network or process dependencies — it's pure
string/crypto logic, built entirely on the OTP `:crypto` application (no
external dependency).

# `sign`

```elixir
@spec sign(String.t(), String.t(), idap: String.t() | nil, eat: String.t() | nil) ::
  {timestamp :: String.t(), signature :: String.t()}
```

Returns `{timestamp, signature}` for the given inputs. `idap` and `eat`
are optional and omitted from the authentication string when `nil`.

---

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