[erlang-questions] crypto.generate_key() with PrivKeyIn fails

Bernard Kolobara me@REDACTED
Thu Jul 18 12:57:40 CEST 2019



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




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20190718/e22ee849/attachment.htm>

More information about the erlang-questions mailing list