Manually generating key pairs
Generating key pair
Amazon Pay uses asymmetric encryption to secure communication. You will need a public/private key pair and a corresponding Public Key ID (a unique Amazon Pay identifier for the key pair) to access Amazon Pay. You can manually generate a public/private key pair using these instructions:
openssl genpkey -out privateKey.pem -algorithm RSA -pkeyopt rsa_keygen_bits:2048
openssl rsa -in privateKey.pem -pubout > publicKey.pub
ssh-keygen -t rsa -b 2048 -m PKCS8 -f privateKey.pem
ssh-keygen -f privateKey.pem -e -m PKCS8 > publicKey.pub
openssl genpkey -out privateKey.pem -algorithm RSA -pkeyopt rsa_keygen_bits:2048
openssl rsa -in privateKey.pem -pubout > publicKey.pub
Once you have generated a key pair, you can exchange the public key for a Public Key ID using Amazon Pay Integration Central: US, EU, JP.
Exchanging public key for Public Key ID
Follow these instructions to exchange the public key you generated in the previous step for a Public Key ID:
- Navigate to Amazon Pay Integration Central: US, EU, JP.
- Identify as a “Self-developed” integration
- Select “Self-developed” option from the drop-down menu
- Use the default “One-time Payments, Single Authorization” payment type setting
- Click on the “Get instructions” button
- Create a public/private key pair
- Navigate to the “API keys” section
- Click on the “Create keys” button
- Select option "Use an existing public key to create API credentials"
- Name your API keys. Use a descriptive name, the name will be used to differentiate between multiple keys when you need to manage them in Integration Central. When naming the keys, you should consider who is using it and what they’re using it for
- Click “Create keys” to create your Public Key ID