From a20dafacdef49726c91b241ed77a87d912b42ccb Mon Sep 17 00:00:00 2001 From: Moon Man Date: Sat, 24 Aug 2024 22:54:30 +0000 Subject: [PATCH] uses keyagent now --- lib/vonbraun/http_signature.ex | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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