I generated my public/private key pair using
ssh-keygen -t rsa -b 2048 -v
and then needed a .pem file and followed this https://serverfault.com/questions/706336/how-to-get-a-pem-file-from-ssh-key-pair
ssh-keygen -f id_rsa -e -m pem
-----BEGIN RSA PUBLIC KEY-----
but then i found this https://gist.github.com/mingfang/4aba327add0807fa5e7f
openssl rsa -in ~/.ssh/id_rsa -outform pem
-----BEGIN RSA PRIVATE KEY-----
why is the output different?