if i run openssl genrsa -out private.pem 2048 to make a RSA key saved to private.pem, i'm unable to read it with pem:read-from-file.
firstly, the file's header is "BEGIN PRIVATE KEY", not "BEGIN RSA PRIVATE KEY", so the assoc call fails.
but even if i add RSA to the pem file, or remove the RSA from the assoc string that does the check, read-private-key still fails and i get the Unexpected format error.
do you have any ideas about how to get this working? or how to create a private key pem file in a way that this library will happily read it?
(apologies if this is glaringly obvious, i'm no crypto expert.)
if i run
openssl genrsa -out private.pem 2048
to make a RSA key saved toprivate.pem
, i'm unable to read it withpem:read-from-file
.firstly, the file's header is "BEGIN PRIVATE KEY", not "BEGIN RSA PRIVATE KEY", so the
assoc
call fails.but even if i add RSA to the pem file, or remove the RSA from the assoc string that does the check,
read-private-key
still fails and i get theUnexpected format
error.do you have any ideas about how to get this working? or how to create a private key pem file in a way that this library will happily read it?
(apologies if this is glaringly obvious, i'm no crypto expert.)