openssl genrsa -out myCA.key 2048
This will create an rsa key file named myCA.key that we use to sign the public pem file generated next.
Create a pem file signed with the key:
openssl req -x509 -new -nodes -key myCA.key -sha256 -days 365 -out myCA.pem
This will prompt you to answer some questions to generate the pem file:
At this point you should have 2 files:
myCA.pem myCA.key
The myCA.pem file is the public key.
ALERT: The myCA.key is the private key; which you do NOT want to share.
Protect the private key!