diff options
author | Ingela Anderton Andin <ingela@erlang.org> | 2013-04-30 18:29:26 +0200 |
---|---|---|
committer | Ingela Anderton Andin <ingela@erlang.org> | 2013-05-08 10:39:21 +0200 |
commit | b968404bfb277c64f3ab040fd5921f8583443c6f (patch) | |
tree | ec0a827213758d9cdd66a90ccc2f58318f8cf38b /lib/public_key/src | |
parent | 50605d756a9fc0a247e19922dff53b4a9d639a59 (diff) | |
download | otp-b968404bfb277c64f3ab040fd5921f8583443c6f.tar.gz otp-b968404bfb277c64f3ab040fd5921f8583443c6f.tar.bz2 otp-b968404bfb277c64f3ab040fd5921f8583443c6f.zip |
ssl & public_key: Use new crypto API functions
Diffstat (limited to 'lib/public_key/src')
-rw-r--r-- | lib/public_key/src/public_key.erl | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/public_key/src/public_key.erl b/lib/public_key/src/public_key.erl index 96eaacf60e..f9042d5349 100644 --- a/lib/public_key/src/public_key.erl +++ b/lib/public_key/src/public_key.erl @@ -258,7 +258,7 @@ decrypt_private(CipherText, when is_binary(CipherText), is_list(Options) -> Padding = proplists:get_value(rsa_pad, Options, rsa_pkcs1_padding), - crypto:rsa_private_decrypt(CipherText, format_rsa_private_key(Key), Padding). + crypto:private_decrypt(rsa, CipherText, format_rsa_private_key(Key), Padding). %%-------------------------------------------------------------------- -spec decrypt_public(CipherText :: binary(), rsa_public_key() | rsa_private_key()) -> @@ -324,7 +324,7 @@ encrypt_private(PlainText, is_integer(N), is_integer(E), is_integer(D), is_list(Options) -> Padding = proplists:get_value(rsa_pad, Options, rsa_pkcs1_padding), - crypto:rsa_private_encrypt(PlainText, format_rsa_private_key(Key), Padding). + crypto:private_encrypt(rsa, PlainText, format_rsa_private_key(Key), Padding). %%-------------------------------------------------------------------- -spec generate_key(#'DHParameter'{} | {namedCurve, Name ::atom()} | @@ -652,13 +652,11 @@ do_pem_entry_decode({Asn1Type,_, _} = PemEntry, Password) -> encrypt_public(PlainText, N, E, Options)-> Padding = proplists:get_value(rsa_pad, Options, rsa_pkcs1_padding), - crypto:rsa_public_encrypt(PlainText, [E,N], - Padding). + crypto:public_encrypt(rsa, PlainText, [E,N], Padding). -decrypt_public(CipherText, N,E, Options) -> +decrypt_public(CipherText, N,E, Options) -> Padding = proplists:get_value(rsa_pad, Options, rsa_pkcs1_padding), - crypto:rsa_public_decrypt(CipherText,[E, N], - Padding). + crypto:public_decrypt(rsa, CipherText,[E, N], Padding). path_validation([], #path_validation_state{working_public_key_algorithm = Algorithm, |