halturin / applepay

a Python library for decrypting Apple Pay payment tokens.
MIT License
59 stars 15 forks source link

RSAPrivateKey AttributeError #12

Closed Sergii-Kravets closed 2 years ago

Sergii-Kravets commented 2 years ago

Get this error, please help.

shared_secred = self._private_key.exchange(ec.ECDH(), public_key) AttributeError: '_RSAPrivateKey' object has no attribute 'exchange' Line 71 payment.py

As I understand only EllipticCurvePrivateKey has this attribute. But Apple only wants the RSA key.

Sergii-Kravets commented 2 years ago

I found the reason. To decrypt the token, you need to use the Apple Pay Payment Processing certificate and not the Apple Pay Merchant identity Certificate.