How to generate private keys and public keys using OpenSSL under MAC OS

Source: Internet
Author: User

MAC OS comes with OpenSSL, so you don't have to compile the same source code as shit. You can use OpenSSL directly on the command line.

Open the command-line tool and enter OpenSSL to open OpenSSL, and then just three commands to get it done. The first command generates the private key; the second command converts the RSA private key to the PKCS8 format, and the password is empty; The third command generates the public key.

Last Login:fri Sep 00:59:51 on ttys000

stormerdeimac:~ stormer$ OpenSSL

openssl> genrsa-out Rsa_private_key.pem 1024x768

Generating RSA private key, 1024x768 bit long modulus

....++++++

..................++++++

E is 65537 (0x10001)

openssl> pkcs8-topk8-inform pem-in rsa_private_key.pem-outform pem–nocrypt

Enter Encryption Password:

Verifying-enter Encryption Password:

-----BEGIN ENCRYPTED PRIVATE KEY-----

miicotabbgkqhkig9w0bbqmwdgqistqxv5ap0recaggabiicgcn+n27qujr/tq5b

Stuoymjwy+sbkv4ndwkfgkqpodbbvnpylydxo5bdgyjql6mdrongmyl1gyonwhiy

Blbvvglvwzodummjivyrtyqoeazussdv0ahxf1mpsvhjzhpycuwpo9by+ulcfisq

bqazohhqeky48+tqslv1gcff4pfjaws9tuohq/s65fys/jhhso3fgyih3jpeu73k

kmka4y5tjwdj5schjpzkur3/1hw4+kqqpvrtnwkov98giyhrls/lfthtm9iwkvy+

Gxc2sebnydzwx6wu4n6wnm5ixknh+wpmm2fwsml9pcqh2z2spg0yakarhcivkptn

Mtvk5qclylsqmlf/z3dki2pd4ve//1dsyhr9go+gk0bx1b6ihx0yf21gmrulh7ps

Qmqjrmtqcyufjntkvivub/dsxgb9bgecax8xzp2kblfunnle45gctalqq53okcm6

M41p+rqdgj4oqxvmiiirzzmycn+mxz64b7f5dfu+7tmmqv2rppbr4awcxollku/z

h7erlfnxzotgm29kiytabiwqmxa03o9pzjei9yfvmdwwa40wgknh5pjtfsujw57r

kv6qzpp8chzydwqlyjbj0s2yoaluzi8nd2y3lgk3eywqdercd0chh1srav2jccb+

Ohaq4ou1raskukhvp7gxukut7yzgz9b57l0ilp+764ozoqmlmwstbo3okahi7yev

Xlts9wqfw2cde1fjxv/iphr1+mu7odixlrqwcwwrgussehd4v6ykn5mo69xputzd

Q5qyvo7htfg8sq6pqzmqfqe0xs7thf9djp+xjxuuwjx8c9dpzlmb02bh47cmg6jf

q/zb1i4=

-----END ENCRYPTED PRIVATE KEY-----

openssl> rsa-in rsa_private_key.pem-pubout-out Rsa_public_key.pem

Writing RSA Key

Finally attached.

Generated files:

That's it, it's simple.

How to generate private keys and public keys using OpenSSL under MAC OS

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.