1. private key
openssl genrsa -out private.pem 1024
-----BEGIN RSA PRIVATE KEY-----
MIICXAIBAAKBgQDDPs8x8VeItcPWNqA+e+cMEjWcXxxwrO4za+SmAuRp9VzchfGF
SN5djLPC9votlVK8KZTqhEPcRr4AmDrXen7CKBjkD48JCyhPlYV/DrQ1RqaUFCKy
JEQOG3VHJRvnU6r80uX5k4MI7AfvXpZSXYhsVG3gFJDLqmdfyOKy9HEVPwIDAQAB
AoGALObk/7dhSi+DOmCVuckE+eG2MqAtCjy7C1hk3UkM/tFO6ehkAyMfAKS7Mrta
DeGphVyKwuRoNuCOEdTws12YiOeEwC/h6a3XlFheUUGDHp9gO6Qi/6RmihLZpTgU
DSNUzV8ZYCszIJukVFpV87zXWFcbRaLLNXuoNbwOO8xN5AECQQDo3+PfhBqYw9+x
GTxC4iShibrfzF6bLu+AqLpF2JEWKnR6hZPGdUMYqUtadVSsvVYnySJRwRsGgo52
RODeE3vPAkEA1qJQR2Dq6wiLV1VE+SFq0+AO8Gt1pt8QldgZWAotn02zfTi7maJ/
dcy0WDM7VUr/pPkK+WvQDEopTR0ky7z7kQJAXtW2lfLVZfr2oMeXG+G+ay6MtNEk
gev2Sx3rZcBRLYaykqbNTFe6sFNZRYhcqFAewusNF+AdImSOoalhLe8fTwJBAMRs
zT1VtAgezK7DKZk5/PMkRWe/YG+0CxCnMSKCRhhZWt9JsV47+ZwMGCvzzuQS+/y1
slZrVX45zKx29HrEXBECQDKWIAGVuKkZep1LYn4/dGJsBd+ELM/m8SiIVj5IVDsy
nDJW1qbyTZk3n6E2A/2SjXJmrqM1Miz7SAEajaiu4oE=
-----END RSA PRIVATE KEY-----
2. public key
openssl rsa -in private.pem -pubout -out public.pem
-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDPs8x8VeItcPWNqA+e+cMEjWc
XxxwrO4za+SmAuRp9VzchfGFSN5djLPC9votlVK8KZTqhEPcRr4AmDrXen7CKBjk
D48JCyhPlYV/DrQ1RqaUFCKyJEQOG3VHJRvnU6r80uX5k4MI7AfvXpZSXYhsVG3g
FJDLqmdfyOKy9HEVPwIDAQAB
-----END PUBLIC KEY-----
备注:以上命令在MAC上亲测通过。
网友评论