Skip to content

Commit

Permalink
EST
Browse files Browse the repository at this point in the history
  • Loading branch information
5HT committed Oct 25, 2024
1 parent a7b3635 commit 4013ad0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ <h3>SIGNING</h3>
<section>
<h3>ENCRYPTION</h3>
<div><ul><li>AES</li>
<li>AES-KW</li>
<li>CMS</li>
<li>ДСТУ 7624:2014</li>
</div> <br />
Expand All @@ -64,6 +65,7 @@ <h3>DERIVATION</h3>
<div>
<ul><li>KDF</li>
<li>HKDF</li>
<li>PBKDF2</li>
</ul>
</div>
</section>
Expand Down
16 changes: 5 additions & 11 deletions lib/services/est.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,21 @@ defmodule CA.EST do

post "/.well-known/est/simpleenroll" do CA.EST.Post.post(conn, [], "Authority", [], "ENROLL") end
put "/.well-known/est/simplereenroll" do CA.EST.Put.put(conn, [], "Authority", [], "RE-ENROLL") end
get "/.well-known/est/cacerts" do CA.EST.Get.get(conn, [], "Authority", [], "CHECK") end
get "/.well-known/est/cacerts" do CA.EST.Get.get(conn, [], "Authority", [], "ROOT") end
get "/.well-known/est/csrattrs" do CA.EST.Get.get(conn, [], "Authority", [], "ABAC") end
put "/.well-known/est/fullcmc" do CA.EST.Put.put(conn, [], "Authority", [], "CMC") end

# See Page 36 of RFC 7030

# iex(37)> :"EST".decode(:CsrAttrs, y)
# > :"EST".decode(:CsrAttrs, y)
# {:ok,
# [
# oid: {1, 2, 840, 113549, 1, 9, 7},
# attribute: {:Attribute, {1, 2, 840, 10045, 2, 1},
# [<<6, 5, 43, 129, 4, 0, 34>>]},
# attribute: {:Attribute, {1, 2, 840, 113549, 1, 9, 14},
# [<<6, 7, 43, 6, 1, 1, 1, 1, 22>>]},
# attribute: {:Attribute, {1, 2, 840, 10045, 2, 1}, [{1, 3, 132, 0, 34}]},
# attribute: {:Attribute, {1, 2, 840, 113549, 1, 9, 14}, [{1, 3, 6, 1, 1, 1, 1, 22}]},
# oid: {1, 2, 840, 10045, 4, 3, 3}
# ]}
# iex(38)> y
# <<48, 65, 6, 9, 42, 134, 72, 134, 247, 13, 1, 9, 7, 48, 18, 6, 7, 42, 134, 72,
# 206, 61, 2, 1, 49, 7, 6, 5, 43, 129, 4, 0, 34, 48, 22, 6, 9, 42, 134, 72, 134,
# 247, 13, 1, 9, 14, 49, 9, 6, 7, ...>>
# iex(39)> x
# > x
# "MEEGCSqGSIb3DQEJBzASBgcqhkjOPQIBMQcGBSuBBAAiMBYGCSqGSIb3DQEJDjEJBgcrBgEBAQEWBggqhkjOPQQDAw=="

match _ do send_resp(conn, 404, "Please refer to https://authority.erp.uno for more information.\n") end
Expand Down

0 comments on commit 4013ad0

Please sign in to comment.