# Referência de assinatura no firmware

```cpp
bodyHash = sha256Hex(jsonBody);
canonical = method + "\n" + path + "\n" + timestamp + "\n" + nonce + "\n" + bodyHash;
signature = hmacSha256Hex(deviceSecret, canonical);

http.addHeader("X-H2O-Device-ID", deviceId);
http.addHeader("X-H2O-Timestamp", String(timestamp));
http.addHeader("X-H2O-Nonce", nonce);
http.addHeader("X-H2O-Signature", signature);
```

A implementação de produção deve usar `WiFiClientSecure` com certificado raiz ou bundle de CA e nunca `setInsecure()`.
