Understand the TPInAppReceipt architecture
masterThe library is structured into three distinct layers that separate data modeling, parsing, and verification:
- Core: Contains the data models.
AppReceiptis the primary typealias representing the receipt structure. It uses generic PKCS#7 types (likeContentInfo,SignedData, andSignerInfo) to model the ASN.1 structure, whileInAppReceiptPayloadandInAppPurchasehold the actual decoded receipt data. - Decoder: Responsible for parsing raw data. It uses an
Engineto transformDatainto anAppReceipt. - Validator: Responsible for verifying the receipt. It composes multiple
ReceiptVerifierimplementations (such as chain, signature, hash, and meta verifiers) and runs them in parallel using aTaskGroup.
All core types are Sendable and Hashable.