[Back to homepage] [Download this example]
$ openssl genrsa -out x.pem 2048 Generating RSA private key, 2048 bit long modulus ........+++ ..+++ e is 65537 (0x10001) $ cat x.pem -----BEGIN RSA PRIVATE KEY----- MIIEpAIBAAKCAQEAr0V86BxxU+giF0s0fxJWunDad/NUFUqfiStGhREbb6u5TvTb WMyDbCW8Xj/WMC+qZoGD0eLi0NhGSMnqn+4AdQGnSRdtXePIq+1o784/RjsHgTjK qgh685iiAeSfWYrMth3KMS5GPKjCC7egsGHgB7Lvu2XvXfnyMiVAI5fxx1UKPPHl 4IpUlSXb9Uqia5rVurDbQuICk4DEK21POtvUC5wqnkc1OY//SSHeU6aKvVupaGbo 6jv3FM178mByX9Q6jJUoyVvtYcxYCg3eeLzNuUz+IKepUZZauyUNSo321rTIiibb LyQNloUeZIgYynR20EPuPDExN96s1eG8RMn4IwIDAQABAoIBABmWq4W3oVP+r/t2 n1Nt+ft+PmcEv2HcYy5DgygqNzc2evdsCBoOwaEoYTfhWgPu8ZHFltktpq+W46v8 zqRKuwZaF3I0WWM7vjBbmNZp5hL6yz2ybOQmGM03m29rUVhhS0HLV5mWh+qTOME9 LdiScYKuPRG+8BNoSlPH3HVV2ZagNd+iDzAV0sMjStEY2NrsbskhoOARAoN939QL fK1MiQ6DTSiilhlk7y18vriOMm3e8TvoGXR8McMRYgROv4Gwpc8B+HYBRAHhGXih BzAl0Mf7GxJoc8SwNRecblWF7lLidCMaGvrRqVG/ivdiJojDYuaQcwq2HOgZK9Z2 CEvQ3wECgYEA2S9rmIwDrt5ZOQDD8AnwuftBwrvJpzyBw1sfCpqxb1kp0lGv6hzG ePWC6SsQlImfPBIxImhYHWbsoHCQuyfYzUjyX384j+PLYhPNvHsBlMBfxA+mULI3 /LKPhF4pNNxr1WovYfzXDgcV2xyr+weslFLi3ULjx9McyWCmE4WugW0CgYEAzphx W2ZfL7+gmP3Yn99h7cr7PieUb1b8WIWDwq2ePJa3z9iVnWn6GRkUyOxOmrH8qkON ZCMhVCI8VVyL+Y+8uXleF2rXUyJBTJrJIKzm3P2+6Tkm2mlSjA72+ywQv5nxbkRm 1D+pWxTDQc+khRFI21/ARi/aepCwOzobKETa9c8CgYEAzuzgXdphE/YjGi2Bga1m 3zvl3syeh6kdlWy2+ZqDnaxdLVbI/YxnCQ4ZqWBvjqZEwa4vhDHYakMLBp3ZN4fy hzyOOLB0yptlxs9JgN/NlNVpKNskQdRbhXb3SE2SgxvT3eUqufh1SZc0mqwJq8YX BsamAdvePCAHWFKuSQFgT00CgYEAhgDRPjTHtwP32mSE9yYAsioADw/DMvjcE1r+ 3O6afbhRH8rfOMx9wXvIRI8qaSLbvWC1vGcg/h56ve+ah1RZWIDFrDDL3AuTCWo4 3S3pTRx1kXdVoUPBnEE0qDSr5Guo8xoBDNkCM6bjA7P4hatxc4HHCH+PmgJxnOkS pmsLD3cCgYBB9EbW0ITzlDxqgATp4rSMLP0Af/tJ/6y8AuLvnCMztl4ezuyMan8L IkQj0FbqEdMJtcD3o0vj/z5XI1TonlILs32N+Tu93dAcKGadzJaxhCWar2ptiyC3 52TJkHShk9OqVMnB3TRQpdiBizLFRZy/LcVgvuKjjwRid/eSWYBcyA== -----END RSA PRIVATE KEY-----
$ openssl rsa -in x.pem -pubout writing RSA key -----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAr0V86BxxU+giF0s0fxJW unDad/NUFUqfiStGhREbb6u5TvTbWMyDbCW8Xj/WMC+qZoGD0eLi0NhGSMnqn+4A dQGnSRdtXePIq+1o784/RjsHgTjKqgh685iiAeSfWYrMth3KMS5GPKjCC7egsGHg B7Lvu2XvXfnyMiVAI5fxx1UKPPHl4IpUlSXb9Uqia5rVurDbQuICk4DEK21POtvU C5wqnkc1OY//SSHeU6aKvVupaGbo6jv3FM178mByX9Q6jJUoyVvtYcxYCg3eeLzN uUz+IKepUZZauyUNSo321rTIiibbLyQNloUeZIgYynR20EPuPDExN96s1eG8RMn4 IwIDAQAB -----END PUBLIC KEY-----