summaryrefslogtreecommitdiff
path: root/verifycert.erl
blob: 2fafca97a1a149899ba6afdf23fd687239f5b932 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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.