Create a public-private key pair. The pair is stored in the generated mykey.pem file.
$ openssl genrsa -out mykey.pem 1024Extract the public key and print it out.
$ openssl rsa -in mykey.pem -pubout > mykey.pubTo just output the public part of a private key:
$ openssl rsa -in key.pem -pubout -out pubkey.pem