diff options
author | Hans Nilsson <[email protected]> | 2017-11-10 12:29:29 +0100 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2017-11-10 12:29:29 +0100 |
commit | 3d0f90bfea2c64c7809c036fb2d569f04aad95e3 (patch) | |
tree | da99534108f24dbb4a0574bbc727c54e16debca9 /lib/crypto/test/engine_SUITE.erl | |
parent | 30147b18b7837034adb94bd2ee2eda3ae2a177bf (diff) | |
parent | 4d9d6776aadee9e0d27b34460fa5269a6b6988aa (diff) | |
download | otp-3d0f90bfea2c64c7809c036fb2d569f04aad95e3.tar.gz otp-3d0f90bfea2c64c7809c036fb2d569f04aad95e3.tar.bz2 otp-3d0f90bfea2c64c7809c036fb2d569f04aad95e3.zip |
Merge branch 'maint'
Diffstat (limited to 'lib/crypto/test/engine_SUITE.erl')
-rw-r--r-- | lib/crypto/test/engine_SUITE.erl | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/lib/crypto/test/engine_SUITE.erl b/lib/crypto/test/engine_SUITE.erl index aac8946893..72bd59f8ab 100644 --- a/lib/crypto/test/engine_SUITE.erl +++ b/lib/crypto/test/engine_SUITE.erl @@ -56,7 +56,9 @@ groups() -> priv_encrypt_pub_decrypt_rsa, priv_encrypt_pub_decrypt_rsa_pwd, pub_encrypt_priv_decrypt_rsa, - pub_encrypt_priv_decrypt_rsa_pwd + pub_encrypt_priv_decrypt_rsa_pwd, + get_pub_from_priv_key_dsa, + get_pub_from_priv_key_ecdsa ]}]. @@ -410,6 +412,31 @@ pub_encrypt_priv_decrypt_rsa_pwd(Config) -> key_id => key_id(Config, "rsa_public_key.pem")}, pub_enc_priv_dec(rsa, Pub, Priv, rsa_pkcs1_padding). +get_pub_from_priv_key_rsa(Config) -> + Priv = #{engine => engine_ref(Config), + key_id => key_id(Config, "rsa_private_key.pem")}, + Pub = crypto:privkey_to_pubkey(rsa, Priv), + ct:log("rsa Pub = ~p",[Pub]), + sign_verify(rsa, sha, Priv, Pub). + +get_pub_from_priv_key_dsa(Config) -> + Priv = #{engine => engine_ref(Config), + key_id => key_id(Config, "dsa_private_key.pem")}, + Pub = crypto:privkey_to_pubkey(dss, Priv), + ct:log("dsa Pub = ~p",[Pub]), + sign_verify(dss, sha, Priv, Pub). + +get_pub_from_priv_key_ecdsa(Config) -> + Priv = #{engine => engine_ref(Config), + key_id => key_id(Config, "ecdsa_private_key.pem")}, + Pub = crypto:privkey_to_pubkey(ecdsa, Priv), + case Pub of + notsup -> {skip, "ECDSA not implemented"}; + _ -> + ct:log("ecdsa Pub = ~p",[Pub]), + sign_verify(ecdsa, sha, Priv, Pub) + end. + %%%================================================================ %%% Help for engine_stored_pub_priv_keys* test cases %%% |