MAC generates public key private key

Source: Internet
Author: User
Objective

Requires developers to use OpenSSL locally to generate private and public keys

Because the Mac comes with the OpenSSL tool, you don't have to download the OpenSSL tool like Windows

Step 1. Create a folder where the terminal enters the folder

Cd/users/tanqihong/desktop/rsa

2. Terminal input OpenSSL open tool 3. Generate RSA private key

Genrsa-out RSA_PRIVATE_KEY.PEM 1024

The command generates a 1024-bit private key, which generates a successful interface as follows:

At this point we can see the Rsa_private_key.pem file under the current path.

4. Convert RSA private key to PKCS8 format

Input command Pkcs8-topk8-inform pem-in rsa_private_key.pem-outform pem–nocrypt, and enter

Enter the password, enter, verify the password, enter
The result of a successful birth is a private key in the PKCS8 format, such as:

5. Generating the RSA public key

Enter command rsa-in rsa_private_key.pem-pubout-out Rsa_public_key.pem, and enter,
Get the results of a successful build, such as:

6. Exit Exit7. To view the folder, change the. pem file inside to a TXT file to see what's inside.

MAC generates public key private key

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.