Apple Pay Certificates
⚠️ VERY IMPORTANT: Certificate Types & Algorithms
Certificate Type | Algorithm | Key Size
Apple Pay Payment Processing | ECC | 256-bit
Apple Pay Merchant Identity | RSA | 2048
👉 You need BOTH certificates for Apple Pay:
- Merchant Identity (RSA) → merchant session validation
- Payment Processing (ECC) → decrypt & process payments
🔐 Step 1: Generate Private Key
Run this on any Linux server, WSL, Docker, or Windows (with OpenSSL installed):
openssl genrsa -out merchant_id_private.key 2048
✔ This file is VERY IMPORTANT
✔ Do not lose it
✔ Never upload it to Apple
✔ Store it securely (e.g. encrypted storage / secrets manager)
🧾 Step 2: Generate the CSR
Now generate the CSR using that private key:
openssl req -new -key merchant_id_private.key -out merchant_id.csr
You’ll be prompted for details.
Use this guidance 👇
Country Name (2 letter code) [AU]: AUState or Province Name: New South WalesLocality Name: SydneyOrganization Name: Your Company Pty Ltd ← must match Apple accountOrganizational Unit Name: ITCommon Name: Apple Pay MerchantEmail Address: admin@yourdomain.com
⚠️ Important Notes
- Organization Name must match what’s in your Apple Developer account
- Common Name can be anything descriptive
- Email is optional but recommended
After this, you’ll have:
merchant_id_private.key ← keep secretmerchant_id.csr ← upload to Apple
🍎 Step 3: Upload CSR to Apple Developer Portal
- Go to Apple Developer → Certificates
- Choose the certificate type you’re creating:
- Apple Pay Payment Processing Certificate
- or Apple Pay Merchant Identity Certificate
- Upload
merchant_id.csr - Download the generated
.cerfile
🔄 Step 4: Convert Apple Certificate to PEM
Apple gives you a .cer file — OpenSSL usually want .pem.
Convert it:
openssl x509 -inform der -in merchant_id.cer -out merchant_id.pem
🔐 Step 1 — Generate ECC Private Key (256-bit)
openssl ecparam -name prime256v1 -genkey -noout -out apple_pay_ecc_private.key
✔ This creates an ECC P-256 key
✔ This is exactly what Apple expects
🧾 Step 2 — Generate the ECC CSR
openssl req -new -key apple_pay_ecc_private.key -out apple_pay_ecc.csr
Use the same org details as before:
Country Name (2 letter code): AUState or Province Name: New South WalesLocality Name: SydneyOrganization Name: Your Company Pty Ltd ← must match Apple accountOrganizational Unit Name: ITCommon Name: Apple Pay Payment ProcessingEmail Address: admin@yourdomain.com
Now you have:
apple_pay_ecc_private.key ← KEEP SECRETapple_pay_ecc.csr ← UPLOAD TO APPLE
🍎 Step 3 — Upload to Apple (Correct Certificate Type)
In Apple Developer Portal:
- Go to Certificates
- Click +
- Select:
👉 Apple Pay Payment Processing Certificate - Upload:
👉apple_pay_ecc.csr
🔄 Step 4 — Convert the Downloaded .cer to PEM
After Apple issues the cert:
openssl x509 -inform der -in apple_pay_payment.cer -out apple_pay_payment.pem
Keep files like this:
apple_pay_ecc_private.keyapple_pay_payment.pem
🔒 Permissions:
chmod 600 apple_pay_ecc_private.key
🧠 How This Fits Integration
✔ Merchant Session (RSA cert)
Used when calling Apple’s merchant validation URL (apple-pay-gateway.apple.com)
✔ Payment Processing (ECC cert)
Used when your payment provider (Stripe/Adyen/etc.) decrypts Apple Pay tokens