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