Skip to content
AppDues
Log in
Contact salesSign up

Trusted Entitlements: verifying in-app purchase responses against interception

On-device proxies made it easier to intercept traffic between an app and its backend without a jailbroken device. An interceptor can alter a response so paid features appear unlocked even though no purchase occurred. Trusted Entitlements addresses that gap by adding cryptographic verification of entitlement responses, so the app can check that a response really came from the backend and was not changed in transit.

Why interception matters

The risk is not only a modified receipt on the device. A proxy in the middle can rewrite the answer an app receives about what a user owns. If the app trusts that answer without checking its origin, premium access can be granted on the basis of fabricated data. Verification therefore needs to cover the response itself, not just the transport connection.

How signature verification works

The backend signs each response with a private key. The SDK checks that signature with the matching public key. Only the holder of the private key can produce a signature that passes, and any change to the signed response will cause the check to fail. That gives the app a way to distinguish a genuine backend answer from one altered by an intermediary.

Where it is available and how it is turned on

Trusted Entitlements was integrated into iOS 4.25.0 and later, and Android 6.6.0 and later. Hybrid SDKs were listed as coming soon. Enabling the feature is an opt-in choice made when the SDK is set up, after which the SDK is initialized with the selected mode. The exact configuration contracts are provided in protected modules code0001, code0002 and code0003, referenced here by ID.

Choosing a mode: Disabled, Informational or Enforced

Disabled performs no cryptographic verification and is the default. Informational enables verification but does not block the user on failure; instead it reports the result so the app can decide how to respond. Enforced was described as coming soon and would let the SDK handle validation automatically, returning a specific verification-failed error on a hijack attempt while existing error handling continues to work. The VerificationResult contract, with its four cases, is provided in protected module code0004, referenced here by ID.

What goes into a signature

Each signature draws on several inputs: a secret salt, the public API key, the request path, a one-time random nonce generated by the SDK for each request, the request timestamp, and the response body. An intermediate key, stored in the backend with an expiration date, signs those components. That intermediate key is itself signed with a root private key. On the device, the SDK first checks the intermediate key signature and its expiration using the public root key, then uses the intermediate key to verify the response components.

Why signature verification instead of SSL pinning

SSL pinning embeds a certificate public key in the app and checks the connection against it. It was rejected here because replacing a pinned certificate can break older SDK versions already in production. Signature verification also gives the app more control over what happens when a check fails, whereas pinning operates at the operating-system level. If a root key were ever compromised, the planned response was to keep signing with that key so existing apps keep working as before, while shipping a new SDK version with a new key for users to adopt over time.

Transition and compatibility checklist

Switching from Disabled to Informational invalidates all caches, because previously cached data cannot be verified. The first launch after enabling the feature therefore needs a network connection at least once to refresh entitlements. After that refresh, subsequent launches can use the cache as usual. Compatibility was listed for Android 4.4 and above and iOS 13.0 and above.

Practical rollout checklist

Before enabling verification, confirm the SDK version meets the minimum, choose Disabled, Informational or Enforced deliberately, plan how Informational failures will be logged or surfaced, warn users that the first launch after switching needs connectivity, and test that cached entitlements refresh correctly after the mode change.

Frequently asked questions

What does Disabled mode do?

No cryptographic check is performed, matching the earlier SDK behavior. This is the default.

What does Informational mode do on failure?

Verification is enabled and a failure is reported through VerificationResult.failed, but parsing does not fail. That lets an app log, track, or build a custom response while still granting access if it chooses.

What was Enforced mode intended to do?

It was described as coming soon. In that mode the SDK would handle validation automatically and a hijack attempt would return an error with a specific code that existing error handling could surface.

What happens when switching modes?

Changing the validation mode invalidates caches because cached data cannot be verified. On the first launch after enabling the feature, the app needs a network connection at least once to refresh entitlements; later launches can use the cache normally.

Which platform versions are compatible?

Android 4.4 and above, and iOS 13.0 and above were listed as supported.