Generate an X509 certificate with new key
openssl req -x509 -sha256 -days 1825 -newkey ec:<(openssl ecparam -name secp256k1) -keyout cakey.pem -out cacert.pem

Generate CSR from a private key file
openssl req --new --key privateKey.txt --out myCSR.csr