Skip to content

Commit

Permalink
EST server /ca /cacerts /csrattrs HTTP endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
5HT committed Oct 28, 2024
1 parent 2657364 commit 2874790
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 24 deletions.
1 change: 1 addition & 0 deletions lib/services/est.ex
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ defmodule CA.EST do
get "/.well-known/est/ca" do CA.EST.Get.get(conn, [], "Authority", [], "CA") end
get "/.well-known/est/cacerts" do CA.EST.Get.get(conn, [], "Authority", [], "CMS") end
get "/.well-known/est/csrattrs" do CA.EST.Get.get(conn, [], "Authority", [], "ABAC") end

post "/.well-known/est/simpleenroll" do CA.EST.Post.post(conn, [], "Authority", [], "ENROLL") end
post "/.well-known/est/simplereenroll" do CA.EST.Post.post(conn, [], "Authority", [], "RE-ENROLL") end
post "/.well-known/est/serverkeygen" do CA.EST.Post.post(conn, [], "Authority", [], "KEYGEN") end
Expand Down
7 changes: 0 additions & 7 deletions lib/services/http/delete.ex

This file was deleted.

6 changes: 3 additions & 3 deletions lib/services/http/get.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule CA.EST.Get do
body = :base64.encode(CA.CSR.read_ca_public())
conn |> put_resp_content_type("application/pkix-cert")
|> put_resp_header("Content-Transfer-Encoding", "base64")
|> put_resp_header("Content-Length", :erlang.integer_to_binary(:erlang.size(body)))
|> put_resp_header("Content-Length", Integer.to_string(byte_size(body)))
|> resp(200, body)
|> send_resp()
end
Expand All @@ -21,7 +21,7 @@ defmodule CA.EST.Get do
body = :base64.encode cms
conn |> put_resp_content_type("application/pkcs7-mime")
|> put_resp_header("Content-Transfer-Encoding", "base64")
|> put_resp_header("Content-Length", :erlang.integer_to_binary(:erlang.size(body)))
|> put_resp_header("Content-Length", Integer.to_string(byte_size(body)))
|> resp(200, body)
|> send_resp()
end
Expand All @@ -30,7 +30,7 @@ defmodule CA.EST.Get do
body = :base64.encode(CA.EST.csrattributes())
conn |> put_resp_content_type("application/csrattrs")
|> put_resp_header("Content-Transfer-Encoding", "base64")
|> put_resp_header("Content-Length", :erlang.integer_to_binary(:erlang.size(body)))
|> put_resp_header("Content-Length", Integer.to_string(byte_size(body)))
|> resp(200, body)
|> send_resp()
end
Expand Down
7 changes: 0 additions & 7 deletions lib/services/http/patch.ex

This file was deleted.

7 changes: 0 additions & 7 deletions lib/services/http/put.ex

This file was deleted.

0 comments on commit 2874790

Please sign in to comment.