RSA Public Key PEM File



What is this? A PEM file which contains your public key.  Public key will contain your Modulus and Exponent. (P and Q).  It is different from private key which contains alot more information.

-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCxSxqCESCdpeXWCprQGMrpwlEg
91EF4Qt1R247gTGaUMgEjFEq9c/UffmtYyccmoIq3n8m/ZcsiCNJNFfGx5h/YEdR
ZyzQjSLg9zt3zu5JbBNx4zb63vvhpCGoMf65y/RvMs+XjSBl8ybl0vbbrC62YH1I
7ZJYSbKhXr3ILHyUSwIDAQAB
-----END PUBLIC KEY-----

OpenSSL

To generate a rsa key

openssl genrsa -out private.pem 1024

To view your private key

openssl pkey -in private.pem -text

To generate a public key (your private key already contain your public key)

openssl pkey -in private.pem -out public.pem -pubout

View our public key (noticed the additional -pubin argument)

openssl pkey -in public.pem -pubin -text





Comments

Popular posts from this blog

The specified initialization vector (IV) does not match the block size for this algorithm