diff --git a/lib/vonbraun/http_signature.ex b/lib/vonbraun/http_signature.ex index 0c46b9c..6493b81 100644 --- a/lib/vonbraun/http_signature.ex +++ b/lib/vonbraun/http_signature.ex @@ -3,10 +3,6 @@ defmodule HTTPSignature do Implements RFC 9421 HTTP Signatures using the Digest header. """ - @algo :sha256 - # Load this securely in production - @key "secret_key" - @spec create_signature_header(map(), list(), String.t(), binary()) :: String.t() def create_signature_header(headers, include_headers, key_id, body) do digest = compute_digest(body) @@ -42,7 +38,7 @@ defmodule HTTPSignature do end defp sign(data) do - :crypto.hash(@algo, [@key, data]) + :crypto.hash(:sha256, [Vonbraun.KeyAgent.get_private_key(), data]) |> Base.encode64() |> String.downcase() end