Apple Pay Certificates
Β
https://register.apple.com/resources/messages/msp-api-tutorial/applepay#integrating-apple-pay
Β
β οΈ 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]: AU
State or Province Name: New South Wales
Locality Name: Sydney
Organization Name: Your Company Pty Ltd β must match Apple account
Organizational Unit Name: IT
Common Name: Apple Pay Merchant
Email 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 secret
merchant_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.csrDownload 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): AU
State or Province Name: New South Wales
Locality Name: Sydney
Organization Name: Your Company Pty Ltd β must match Apple account
Organizational Unit Name: IT
Common Name: Apple Pay Payment Processing
Email Address: admin@yourdomain.com
Now you have:
apple_pay_ecc_private.key β KEEP SECRET
apple_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 CertificateUpload:
π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.key
apple_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 (https://apple-pay-gateway.apple.com/paymentservices/paymentSession)
β Payment Processing (ECC cert)
Used when your payment provider (Stripe/Adyen/etc.) decrypts Apple Pay tokens