Generating public and private keys with OpenSSL under Mac, Macopenssl generating _php tutorials

Source: Internet
Author: User
Tags modulus

Using OpenSSL to generate public and private keys under Mac, Macopenssl generates

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.

Sticker Code No Nonsense

wangbindemacbook-pro:~ wangbin$ OpenSSL

Openssl> Genrsa-out Rsa_private_key.pem Here if the number of non-digits is 512 by default

Generating RSA private key, modulus bit long

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


E is 65537 (0x10001)

openssl> Genrsa-out RSA_PRIVATE_KEY.PEM 1024

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 Convert to Pkcs8

















openssl> rsa-in rsa_private_key.pem-pubout-out RSA_PUBLIC_KEY.PEM output Public key

Writing RSA Key

Openssl> true techarticle The Mac uses OpenSSL to generate the public and private keys, Macopenssl generation Mac OS comes with OpenSSL, so you don't have to compile the same source as the shit. You can use OpenSSL directly on the command line. Play ...

  • 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: 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.