iaplocal
is a Go library that supports Apple Local In-App Purchase
(IAP) receipt processing.
- Verify the receipt signature against App Root CA certificate.
- Parse the receipt from binary, extract in-app receipts.
- Validate the receipts hash with host GUID.
go install github.com/googollee/iaplocal
The simplest possible usage is:
rootBytes, _ := ioutil.ReadFile("./AppleComputerRootCertificate.cer")
rootCA, _ := x509.ParseCertificate(rootBytes)
receiptB64, _ := ioutil.ReadFile("./receipt_b64")
receiptBytes, _ := base64.StdEncoding.DecodeString(string(receiptB64))
receipt, _ := iaplocal.Parse(rootCA, receiptBytes)
guid, _ := uuid.FromString(hostGUID)
receipt.Verify(guid)
See LICENSE
.