Alipay, China's leading third-party online payment solutionAlipay, China's leading third-party online payment solution

      Key pair generation and validation

      Merchants can use Alipay API Tool to generate key pairs, and validate whether the public key and private matches.


      The following video explains how to generate and validate key pairs:


      #Key pair generation

      Complete the following steps to generate a key pair:

      1. Download Alipay API Tool.
      2. Extract AlipayApiTool.zip.
      3. Depending on your operating system, execute Run_Windows.bat or Run_Mac.
      4. Click New to generate a key pair.


      #Key pair validation

      Complete the following steps to validate your key pair:

      1. Depending on your operating system, execute Run_Windows.bat or Run_Mac.
      2. Enter your private key and public key in the fields.
      3. Click Validate to see whether the private key and public key matches.


      #Uploading your public key

      RSA2 public keys and RSA public keys are uploaded by using different methods. For security reasons, RSA2 keys are strongly recommended.


      #RSA2 key

      To upload your RSA2 public key to Alipay, complete the following steps.

      1. Log in to Alipay Global Site and go to Business Center -> Online Payment / Instore Payment Product.

      image.png


      1. At My Order tab, click See Key.

      my order.png


      1. Find RSA2 Key Information and click Edit my public key.

      image.png


      1. Enter your RSA2 key in the text box and then click SAVE.

      image.png


      #RSA key

      You can use RSA keys, but RSA2 keys are recommended. If you have to use RSA keys, provide your public key and PID to Alipay Technical Support (overseas_support@service.alibaba.com) to upload the public key.


      #Viewing public key

      To view Alipay public keys and your public keys, complete the following steps:

      1. Log in to Alipay Global Site ->Business Center -> Online Payment / Instore Payment Product -> See Key, and then click See my public key.

      see.png


      1. Enter your payment password and then click Confirm.

      image.png


      You can then view your public key and Alipay public key. For example:

      {6B8F887E-43F6-4227-937B-A4999552AB43}_20200102151516.jpg


      Note:

      Alipay public key is only provided after you have uploaded your public key.