summaryrefslogtreecommitdiff
path: root/verifycert.erl
diff options
context:
space:
mode:
Diffstat (limited to 'verifycert.erl')
-rwxr-xr-xverifycert.erl15
1 files changed, 15 insertions, 0 deletions
diff --git a/verifycert.erl b/verifycert.erl
new file mode 100755
index 0000000..2fafca9
--- /dev/null
+++ b/verifycert.erl
@@ -0,0 +1,15 @@
+#!/usr/bin/env escript
+%% -*- erlang -*-
+%%! -pa ebin -pa lib/catlfish-0.2.0-dev.ez/catlfish-0.2.0-dev/ebin -pa lib/lager-2.0.3.ez/lager-2.0.3/ebin
+
+main(_) ->
+ {ok, DBEntry} = file:read(standard_io, 100000),
+ %io:format("~p~n", [DBEntry]),
+ Certs = x509:read_pemfiles_from_dir("tests/known_roots/"),
+ Chain = catlfish:chain_from_entry(list_to_binary(DBEntry)),
+ case x509:normalise_chain(Certs, Chain) of
+ {ok, _} ->
+ io:format("ok~n", []);
+ {error, Reason} ->
+ io:format("error: ~p~n", [Reason])
+ end.