diff options
author | Magnus Ahltorp <map@kth.se> | 2015-04-06 03:14:58 +0200 |
---|---|---|
committer | Magnus Ahltorp <map@kth.se> | 2015-04-06 03:14:58 +0200 |
commit | 3d7c2403f16d85222c52ca092f6732671d8af768 (patch) | |
tree | 8cb3d88e1c128c7ab5f9b0c043803ab7540714cf /verifycert.erl | |
parent | f8a36b4a27a976d56448a884b36b4ac2534f09f6 (diff) |
Verify that database entry actually contains the certificate
Diffstat (limited to 'verifycert.erl')
-rwxr-xr-x | verifycert.erl | 15 |
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. |