diff --git a/lib/public_key/src/public_key.erl b/lib/public_key/src/public_key.erl index 8e216aa1ff85..88761a74e60f 100644 --- a/lib/public_key/src/public_key.erl +++ b/lib/public_key/src/public_key.erl @@ -1213,12 +1213,7 @@ sign(DigestOrPlainText, DigestType, Key, Options) -> {extern, Fun} when is_function(Fun) -> Fun(DigestOrPlainText, DigestType, Options); {Algorithm, CryptoKey} -> - try crypto:sign(Algorithm, DigestType, DigestOrPlainText, CryptoKey, Options) - catch %% Compatible with old error schema - error:{notsup,_,_} -> error(notsup); - error:{error,_,_} -> error(error); - error:{badarg,_,_} -> error(badarg) - end + crypto:sign(Algorithm, DigestType, DigestOrPlainText, CryptoKey, Options) end. %%-------------------------------------------------------------------- @@ -1257,12 +1252,7 @@ verify(DigestOrPlainText, DigestType, Signature, Key, Options) when is_binary(Si badarg -> erlang:error(badarg, [DigestOrPlainText, DigestType, Signature, Key, Options]); {Algorithm, CryptoKey} -> - try crypto:verify(Algorithm, DigestType, DigestOrPlainText, Signature, CryptoKey, Options) - catch %% Compatible with old error schema - error:{notsup,_,_} -> error(notsup); - error:{error,_,_} -> error(error); - error:{badarg,_,_} -> error(badarg) - end + crypto:verify(Algorithm, DigestType, DigestOrPlainText, Signature, CryptoKey, Options) end; verify(_,_,_,_,_) -> %% If Signature is a bitstring and not a binary we know already at this