robotmedia / RMStore

A lightweight iOS library for In-App Purchases
Apache License 2.0
2.42k stars 450 forks source link

Validate receipt using Apple Certificate data #198

Open erndev opened 7 years ago

erndev commented 7 years ago

Adds a method to provide Apple's certificate data as an alternative to the certificate url. This can be useful when Apple's certificate is embedded in the source code (base64) instead of being in the app's resources. It's specially useful in Mac Apps, where anyone could replace the certificate in the bundle.

This change does not affect setAppleRootCertificateURL. The receipt can still be validated with the url of the certificate, but if the certificate data exists, it takes precedence over the url.