diff options
author | Linus Nordberg <linus@nordberg.se> | 2014-10-23 14:42:42 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordberg.se> | 2014-10-23 14:42:42 +0200 |
commit | f0b40ee24cb2e95f3ce1a7d06473459f3de2b7d5 (patch) | |
tree | 1b2152955bc4a5f1374448f72457bd9ad18d5b28 /src/x509.erl | |
parent | a77e6b4a9b30588f48fc5cf81bdf4982ef85ce7a (diff) |
Log (info) when adding and rejecting a certificate chain.validate-certchain
Writing to stdout for now, until we've decided on logging framework.
Diffstat (limited to 'src/x509.erl')
-rw-r--r-- | src/x509.erl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/x509.erl b/src/x509.erl index 8b1211d..9b6b386 100644 --- a/src/x509.erl +++ b/src/x509.erl @@ -2,7 +2,7 @@ %%% See LICENSE for licensing information. -module(x509). --export([normalise_chain/2]). +-export([normalise_chain/2, cert_string/1]). -include_lib("public_key/include/public_key.hrl"). @@ -84,6 +84,10 @@ public_key(#'OTPCertificate'{ subjectPublicKey = Key}}}) -> Key. +cert_string(Der) -> + lists:flatten([io_lib:format("~2.16.0B", [X]) || + X <- binary_to_list(crypto:hash(sha, Der))]). + %%%%%%%%%%%%%%%%%%%% %% Precertificates according to draft-ietf-trans-rfc6962-bis-04. |