TN3138: Handling App Store receipt signing certificate changes
Ensure that your app’s local receipt validation is compatible with intermediate certificates that require using the SHA-256 algorithm.
Overview
As part of ongoing efforts to improve security and privacy on Apple platforms, Apple is updating the App Store receipt signing intermediate certificate with one that uses the SHA-256 algorithm. This change affects the sandbox, TestFlight, and App Store environments, on the dates shown below:
Date | Sandbox | TestFlight | App Store |
|---|---|---|---|
January 24, 2025 | Uses SHA-256 certificate; SHA-1 certificate expires | Uses SHA-256 certificate; SHA-1 certificate expires | Uses SHA-256 certificate; SHA-1 certificate expires |
August 16, 2023 | Uses SHA-256 certificate | Uses SHA-256 certificate | |
June 20, 2023 | Uses SHA-256 certificate |
The App Store receipt signing intermediate certificate is in the certificate chain that Apple uses to sign App Store receipts, which are the proof-of-purchase for apps and in-app purchases.
If your app performs on-device receipt validation, it needs to support SHA-256 algorithm to correctly verify Apple’s certificate chain. For more information, see Validating receipts on the device.
Starting January 24, 2025, apps that perform on-device receipt validation and don’t support a SHA-256 algorithm will fail their on-device receipt validation when the App Store updates the receipt. If your app prevents customers from accessing the app or premium content when receipt validation fails, your customers may lose access to their content.
Update your app to support certificates that use the SHA-256 algorithm if your app performs on-device receipt validation.
Determine if your app is affected
Apps that are affected by Apple’s certificate update to SHA-256 include those that do the following:
Perform on-device receipt validation, as described in Validating receipts on the device, and
Use code to verify the chain of trust that doesn’t support the SHA-256 algorithm or relies on an expectation that the certificate encryption uses only SHA-1.
The certificate update does not affect any of the following transaction or receipt validation methods:
Validating app and in-app purchase transactions using AppTransaction and Transaction.
Server-to-server receipt verification using the verifyReceipt endpoint. For more information, see Validating receipts with the App Store.
Update your app to support SHA-256 certificates
Follow these guidelines to update your app to support certificates that use the SHA-256 algorithm for on-device receipt validation:
If your app follows the instructions in Validating receipts on the device, the new certificate affects step 2, which involves verifying the certificate chain. Be sure your app uses the latest certificates from Apple PKI.
Use cryptography code that supports SHA-256 algorithm. If you wrote your own code to verify receipts, update that code to use the SHA-256 algorithm. If your app uses a cryptography library, update the library to the latest version that supports SHA-256 algorithm.
Test your app in the sandbox environment to ensure that your on-device receipt validation succeeds.
Test your app receipt validation in the sandbox environment
Starting June 20, 2023, the sandbox environment produces app receipts that are signed using the SHA-256 intermediate certificate for apps running in iOS 16.6, tvOS 16.6, watchOS 9.6, and macOS 13.5. Follow these steps to test how your app handles the receipts:
On a test device, sign in to the App Store with your Sandbox Apple ID.
Launch the app.
Perform one or more actions that cause the App Store to send an updated receipt to your app, such as the following:
Make an in-app purchase
Call restoreCompletedTransactions() or restoreCompletedTransactions(withApplicationUsername:).
Verify that Apple signed the receipt with a SHA-256 certificate. Decode your app receipt as a PKCS #7 container, then confirm that the
Receipt Creation Datestring, identified as ASN.1 Field Type 12, is set to June 20, 2023 or later in the sandbox environment. (In the production environment, that date is August 16, 2023 or later.)Ensure that your app calls its on-device receipt validation code with the new receipt.
Check that your on-device receipt validation succeeds.
If your app successfully verifies the receipt and you’ve confirmed that the new receipt uses the updated certificate in its certificate chain, your app is ready for Apple’s SHA-256 intermediate certificate update.
Revision History
2024-10-31 Added the SHA-1 expiry date. Noted that the
verifyReceiptendpoint is now deprecated. Made other minor editorial changes.2023-08-29 Updated date timeline.
2023-05-26 First published.
See Also
Latest
TN3205: Low-latency communication with RDMA over ThunderboltTN3206: Updating Apple Pay certificatesTN3179: Understanding local network privacyTN3190: USB audio device design considerationsTN3194: Handling account deletions and revoking tokens for Sign in with AppleTN3193: Managing the on-device foundation model’s context windowTN3115: Bluetooth State Restoration app relaunch rulesTN3192: Migrating your iPad app from the deprecated UIRequiresFullScreen keyTN3151: Choosing the right networking APITN3111: iOS Wi-Fi API overviewTN3191: IMAP extensions supported by Mail for iOS, iPadOS, and visionOSTN3134: Network Extension provider deploymentTN3189: Managing Mail background traffic loadTN3187: Migrating to the UIKit scene-based life cycleTN3188: Troubleshooting In-App Purchases availability in the App Store