aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/src/ssl_config.erl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2017-10-02 15:17:13 +0200
committerIngela Anderton Andin <[email protected]>2017-11-08 09:33:02 +0100
commit7a0a2e9fa132cba32f4a287d03c04e9ff78a44ec (patch)
tree630fc2ba04dcece98e3c5c94013926899fdf3fab /lib/ssl/src/ssl_config.erl
parentd4f61c4e26005740388668f3773871f043366342 (diff)
downloadotp-7a0a2e9fa132cba32f4a287d03c04e9ff78a44ec.tar.gz
otp-7a0a2e9fa132cba32f4a287d03c04e9ff78a44ec.tar.bz2
otp-7a0a2e9fa132cba32f4a287d03c04e9ff78a44ec.zip
ssl: Add private key configuration for crypto engine
Diffstat (limited to 'lib/ssl/src/ssl_config.erl')
-rw-r--r--lib/ssl/src/ssl_config.erl10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/ssl/src/ssl_config.erl b/lib/ssl/src/ssl_config.erl
index e4611995ec..022fb7eac0 100644
--- a/lib/ssl/src/ssl_config.erl
+++ b/lib/ssl/src/ssl_config.erl
@@ -91,7 +91,15 @@ init_certificates(undefined, #{pem_cache := PemCache} = Config, CertFile, server
end;
init_certificates(Cert, Config, _, _) ->
{ok, Config#{own_certificate => Cert}}.
-
+init_private_key(_, #{algorithm := Alg} = Key, <<>>, _Password, _Client) when Alg == ecdsa;
+ Alg == rsa;
+ Alg == dss ->
+ case maps:is_key(engine, Key) andalso maps:is_key(key_id, Key) of
+ true ->
+ Key;
+ false ->
+ throw({key, {invalid_key_id, Key}})
+ end;
init_private_key(_, undefined, <<>>, _Password, _Client) ->
undefined;
init_private_key(DbHandle, undefined, KeyFile, Password, _) ->