crypto.generate_key() with PrivKeyIn fails

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

crypto.generate_key() with PrivKeyIn fails

Bernard Kolobara



I’m trying to generate a public key out of a private one, but I get a bad argument exception.

Without passing in a private key everything works as expected:


5> {A, B} = crypto:generate_key(ecdh, x25519).






But if I add a private key to the function:


6> crypto:generate_key(ecdh, x25519, B).     

** exception error: bad argument

     in function  crypto:ec_key_generate/2

        called as crypto:ec_key_generate({evp,x25519},




Also being new to this I’m a bit confused with the output of:

7> crypto:info_lib().


  <<"OpenSSL 1.1.1c  28 May 2019">>}]


But my system openssl command reports a different version, but same date:

sh> openssl version

OpenSSL 1.0.2s  28 May 2019




erlang-questions mailing list
[hidden email]