accept-sample-app icon indicating copy to clipboard operation
accept-sample-app copied to clipboard

PEM file for merchant authentication.

Open emberdyn opened this issue 4 years ago • 1 comments

Can you please explain how you generated the PEM file for merchant authentication?
apple-pay-test-cert.pem

I have tried getting my CSR file from auth.net and uploaded it in the apple developer account to get a .cer file. But that .cer file does not have a private key. How did you get a cert with a private key?

Thanks so much for your help. @brianmc

emberdyn avatar Oct 07 '21 18:10 emberdyn

You need to create your own Apple Pay Merchant Identity/PEM File. Its not the same as the .cer file you get from Apple.

To generate the PEM:

  • To manually generate a Certificate, you need a Certificate Signing Request (CSR) file from your Mac
  • Keychain Access -> Certificate Assistant -> Request a Certificate from a Certificate Authority
  • be sure to check "Save to disk"
  • This CSR is submitted to Apple for an Apple Pay Merchant Identity and you get a .cer file back.
  • Double click the .cer file to install it in the Mac keychain.
  • Select both the Certificate and the private key, right click and select "Export 'Certificate and Private Key' as PEM"
  • Chose p12 format and save to disk.
  • Convert the p12 file to a pem file using the openssl command:
  • openssl pkcs12 -in merchant_id.p12 -out merchant_id.pem -nodes -legacy
  • Save the pem file ito use in your implementation

rimager avatar Nov 27 '24 13:11 rimager