Home > Article > Backend Development > Android client Alipay PHP server-side writing_PHP tutorial
Generate private key
Enter the "genrsa -out rsa_private_key.pem 1024" command, press Enter, in the current bin file A rsa_private_key.pem file will be added to the directory, and the file is the original merchant private key (Please save the file properly , PHP This file is required for development languages),
Generate public key
Enter "rsa -in rsa_private_key.pem -pubout -out rsa_public_key.pem" and press Enter, in the current bin A new rsa_public_key.pem file will be added to the file directory, which is the original merchant public key (Please save the file properly,PHP This file is required for development language)
Generate pkcs8 for Android
Enter the command "pkcs8 -topk8 -inform PEM -in rsa_private_key.pem -outform PEM -nocrypt" and press Enter
The php server needs the rsa_private_key.pem just generated and the alipay_public_key.pem from the demo provided by Alipay