Generate RSA public-private key using OpenSSL

Source: Internet
Author: User

In the Windows environment

1. Go to cmd Command window

Switch to the OpenSSL program directory

2, enter the Openssl.exe, enter the OpenSSL command mode

3. Generate private key input " genrsa -out app_private_key.pem  1024 " to generate a 1024-bit private key

Generated content (file name is APP_PRIVATE_KEY.PEM)

4, Input: "Rsa-in app_private_key.pem-pubout-out App_public_key.pem" #生成公钥

Generate content

First enter the OpenSSL tool, and then enter the following command.

1234 OpenSSL> genrsa -out app_private_key.pem 1024#生成私钥OpenSSL> pkcs8 -topk8 -inform PEM -in app_private_key.pem -outform PEM -nocrypt -out app_private_key_pkcs8.pem #Java开发者需要将私钥转换成PKCS8格式OpenSSL> rsa -in app_private_key.pem -pubout -out app_public_key.pem #生成公钥OpenSSL> exit #退出OpenSSL程序

After the above steps, the developer can see the APP_PRIVATE_KEY.PEM (Developer RSA private key) in the current folder (OpenSSL running folder), App_private_key_ PKCS8.PEM (RSA private key of PKCS8 format developer) and APP_PUBLIC_KEY.PEM (developer RSA public key) 3 files.

Generate RSA public-private key using OpenSSL

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.