diff --git a/lib/ssl/doc/src/ssl_crl_cache.xml b/lib/ssl/doc/src/ssl_crl_cache.xml index 6fbc1c1afddb..2955cb498606 100644 --- a/lib/ssl/doc/src/ssl_crl_cache.xml +++ b/lib/ssl/doc/src/ssl_crl_cache.xml @@ -41,36 +41,23 @@ - - - - - delete(Entries) -> ok | {error, Reason} - - - Entries = crl_src()]} - Reason = crl_reason() - + Delete CRLs from the ssl applications local cache.

Delete CRLs from the ssl applications local cache.

- insert(CRLSrc) -> ok | {error, Reason} - insert(URI, CRLSrc) -> ok | {error, Reason} - - - CRLSrc = crl_src()]} - URI = uri() - Reason = term() - + + + Insert CRLs into the ssl applications local cache. -

Insert CRLs, available to fetch on DER format from URI, into the ssl applications local cache.

+

Insert CRLs into the ssl applications local cache, with or without a distribution point + reference URI

diff --git a/lib/ssl/src/ssl_crl_cache.erl b/lib/ssl/src/ssl_crl_cache.erl index c12d829470cc..d88ca80d9009 100644 --- a/lib/ssl/src/ssl_crl_cache.erl +++ b/lib/ssl/src/ssl_crl_cache.erl @@ -72,22 +72,38 @@ fresh_crl(#'DistributionPoint'{distributionPoint = {fullName, Names}}, CRL) -> %% API %%==================================================================== -insert(CRLs) -> - insert(?NO_DIST_POINT, CRLs). +%%-------------------------------------------------------------------- +-spec insert(CRLSrc) -> ok | {error, Reason} when + CRLSrc :: crl_src(), + Reason :: term(). +%%-------------------------------------------------------------------- +insert(CRLSrc) -> + insert(?NO_DIST_POINT, CRLSrc). -insert(URI, {file, File}) when is_list(URI) -> +%%-------------------------------------------------------------------- +-spec insert(DistPointURI, CRLSrc) -> ok | {error, Reason} when + DistPointURI :: uri_string:uri_string(), + CRLSrc :: crl_src(), + Reason :: term(). +%%-------------------------------------------------------------------- +insert(DistPointURI, {file, File}) when is_list(DistPointURI) -> case file:read_file(File) of {ok, PemBin} -> PemEntries = public_key:pem_decode(PemBin), CRLs = [ CRL || {'CertificateList', CRL, not_encrypted} <- PemEntries], - do_insert(URI, CRLs); + do_insert(DistPointURI, CRLs); Error -> Error end; -insert(URI, {der, CRLs}) -> - do_insert(URI, CRLs). +insert(DistPointURI, {der, CRLs}) -> + do_insert(DistPointURI, CRLs). +%%-------------------------------------------------------------------- +-spec delete(Entries) -> ok | {error, Reason} when + Entries :: crl_src() | uri_string:uri_string(), + Reason :: term(). +%%-------------------------------------------------------------------- delete({file, File}) -> case file:read_file(File) of {ok, PemBin} ->