Because these SDKs operate inside security-sensitive payment authentication infrastructure, the fintech partner's identity and implementation-specific identifiers are not disclosed. The engineering scope and system-level behaviour described here are accurate; confidential operational details have been intentionally omitted.

01

At a glance

  • Production reach: native Android and iOS SDKs distributed into hundreds of downstream applications.
  • Protocol scope: EMV 3DS 2.1.0 and 2.2.0, with an optional 3DS1 fallback in the managed integration.
  • Payment context: native app-based authentication for card-not-present transactions, covering frictionless and issuer challenge flows.
  • Integration models: managed, server-directed sessions and a provider-agnostic standalone SDK flow.
  • Mobile responsibility: device-data collection, SDK cryptography, ACS-facing CReq/CRes exchanges, native challenge UI, security warnings and transaction cleanup.
  • Delivery scope: architecture, implementation, testing, application hardening, distributable SDK artifacts and production evolution.
02

What 3D Secure is—and how app-based authentication works

EMV 3-D Secure, commonly called 3DS, 3DS2 or 3D Secure 2.0, is a payment-authentication messaging protocol for online and in-app card-not-present transactions. It allows a cardholder to authenticate with the card issuer before the payment continues to authorization; authentication and payment authorization remain separate decisions. Compared with the browser-centric 3DS1 experience, 3DS2 introduced richer data exchange and native app-based authentication, making frictionless outcomes possible when the issuer has sufficient confidence.

The “3-D” refers to three domains: the merchant / acquirer domain, the issuer domain and the interoperability domain operated by payment systems. EMVCo describes EMV 3DS as an additional security layer for card-not-present e-commerce, designed to reduce unauthorized transactions while supporting consistent authentication across channels and connected devices.

The app-based flow coordinates five main components:

ComponentRole in the authentication flow
3DS Requestor appThe merchant or fintech mobile application that initiates authentication as part of its payment journey.
3DS SDKThe native component embedded in the app. It collects device data, creates transaction cryptographic material and handles direct ACS challenge communication and UI.
3DS ServerThe server-side component that assembles the authentication request and coordinates AReq / ARes and result handling for the 3DS Requestor.
Directory Server (DS)The interoperability component that routes protocol messages between the 3DS Server and the appropriate issuer-side ACS.
Access Control Server (ACS)The issuer-side component that evaluates authentication data, decides whether more evidence is needed and authenticates the cardholder during a challenge.

At a high level, the flow works like this:

  1. Collect context. The 3DS Requestor and its server prepare transaction data while the mobile SDK collects and encrypts device information.
  2. Request authentication. The 3DS Server sends an AReq through the Directory Server to the issuer's ACS.
  3. Choose frictionless or challenge. The ACS evaluates the available risk signals and returns an ARes. A low-risk transaction can complete without cardholder interaction; this is the frictionless flow. If more evidence is required, the ACS requests a challenge.
  4. Authenticate in the app. For a challenge, the mobile SDK establishes an encrypted CReq / CRes channel directly with the ACS. The issuer can request an OTP, a selection, an out-of-band approval in its banking app—potentially using biometrics—or an HTML-based interaction.
  5. Report the result. The ACS sends the final authentication outcome to the 3DS Server through RReq / RRes. The merchant's payment stack can then use that result when continuing to the separate authorization process.

In Europe, 3DS is closely associated with the revised Payment Services Directive (PSD2) and Strong Customer Authentication (SCA). The PSD2 Regulatory Technical Standards require SCA to use two or more independent elements categorized as knowledge, possession and inherence, with dynamic linking to the amount and payee for remote electronic payments. EMV 3DS can support those requirements, but it is a global protocol and a mobile SDK alone does not establish end-to-end regulatory compliance.

Risk-based authentication (RBA) and transaction risk analysis (TRA) are also related but distinct. RBA describes how the issuer and ACS use context to decide whether authentication can remain frictionless or needs a challenge. TRA is a conditional PSD2 exemption applied through payment-service-provider risk controls. Neither the exemption decision nor final payment authorization belongs to the mobile SDK.

That complexity had to become a stable product surface for mobile teams integrating the SDK into their own applications. AirisApps built the native Android and iOS layers end to end, turning the protocol into reusable mobile infrastructure for an international fintech ecosystem.

EMVCo's 3DS documentation defines the Core Specification as the source for the architecture, messages and channels, and the SDK Specification as the device-side component embedded in a 3DS Requestor app. The work described here focused on that device-side product and its direct interaction with the ACS during an app-based challenge.

How app-based 3D Secure works A simplified EMV 3DS mobile authentication flow showing the requestor app and SDK, 3DS Server, Directory Server, issuer ACS, frictionless and challenge paths, and the boundary between authentication and payment authorization. How app-based 3D Secure works Authentication flow and message ownership REGULATORY CONTEXT PSD2 / SCA influences when 3DS is used. MERCHANT / ACQUIRER DOMAIN INTEROPERABILITY DOMAIN ISSUER DOMAIN 3DS Requestor app Embedded mobile 3DS SDK iOS or Android 3DS Server Server-side orchestration Directory Server Issuer ACS Risk decision + challenge AReq AReq ARes ARes ACS decision Frictionless or challenge? Frictionless path ACS completes the risk decision without showing a cardholder challenge in the mobile app. ARes indicates that no challenge is required No challenge required Challenge path Methods: text / OTP · selection · out-of-band · HTML Direct SDK ↔ ACS channel; the 3DS Server and Directory Server are not in the message loop. Mobile 3DS SDK Native challenge UI Issuer ACS Challenge state Encrypted CReq Encrypted CRes Result reporting: ACS ↔ DS ↔ 3DS Server (RReq / RRes) Challenge required Authentication result returned Payment authorization is a separate downstream step.
App-based EMV 3DS: server-side AReq/ARes and RReq/RRes exchanges surround the direct encrypted CReq/CRes challenge channel between the mobile SDK and ACS.
03

The challenge: package a distributed security protocol as a dependable mobile product

A production 3DS SDK must satisfy two audiences at once. Cardholders need a clear, accessible authentication journey. Integrating engineering teams need a small, predictable API that does not expose the protocol's internal complexity.

Behind that API, the SDK has to collect device information, create transaction-specific cryptographic material, preserve message-version rules, validate issuer-provided signed content, communicate directly with the ACS, render multiple challenge types, recover from app switching and return an unambiguous result. A malformed counter, transaction ID or Base64URL value cannot be treated as a cosmetic error.

The product also had to work in many independently released apps. That raised the standard for backward compatibility, lifecycle management, customization, observability and release packaging. A locally correct implementation was not enough; the SDK had to remain safe and understandable when embedded into different host applications.

04

Defining the protocol boundary: what the mobile SDK owns

The most important architectural decision was to keep mobile and server responsibilities explicit.

Message exchangeRouteMobile SDK responsibility
AReq / ARes3DS Requestor and 3DS Server through the Directory Server to the ACSThe SDK produces device-side inputs for the AReq and consumes the challenge parameters returned through the ARes. The host application and 3DS Server own the server-side exchange.
CReq / CResMobile 3DS SDK directly with the ACSThe SDK creates the encrypted challenge channel, sends cardholder actions, validates ACS responses and renders the required challenge UI.
RReq / RResACS through the Directory Server to the 3DS ServerThe SDK preserves the transaction identifiers that connect the flow, but it does not originate this server-side results exchange.

This matches the EMVCo challenge-flow sequence: the 3DS Server sends the AReq, the ACS can request a challenge in the ARes, the app-based client then establishes secure communication with the ACS, and the ACS later reports the authentication outcome through RReq.

The distinction matters commercially as well as technically. The SDK can be integrated without forcing every mobile team to become an expert in 3DS message internals, while backend teams retain control of authentication-provider and payment orchestration.

05

Two integration models: managed sessions and standalone 3DS

AirisApps implemented two ways to use the same mobile authentication capabilities.

Managed, non-standalone sessions

The managed integration offered the smallest public surface. The host app supplied a session ID, session secret and payment scheme. The SDK then retrieved session state and followed one server-directed next action at a time:

  • Collect channel data: initialize a new SDK encryption context, collect protocol-defined device data, encrypt it for the Directory Server and update the session.
  • Challenge cardholder: verify that the 3DS2 session and ACS cryptographic parameters are complete, then start the challenge.
  • Authenticate: enter the configured 3DS1 fallback path when 3DS2 is unavailable.
  • Complete: return the frictionless result and notify the session service.
  • Reject unsupported state: fail predictably if the server returns an incompatible or ambiguous action.

This model kept orchestration on the platform side. The SDK could recursively process the updated session until it reached a frictionless completion, a 3DS2 challenge or the optional 3DS1 route.

Provider-agnostic standalone sessions

The standalone SDK exposed the protocol boundary more directly so a fintech or merchant could use its chosen 3DS Server or authentication provider.

Standalone did not mean serverless, offline or disconnected from the ACS. It meant that the mobile SDK was decoupled from the partner's managed session orchestration while the host retained control of its 3DS Server and backend authentication flow.

The host initialized the SDK with Directory Server data, protocol version, payment scheme, locale and UI configuration. A transaction then returned the fields required for the AReq: SDK Encrypted Data, SDK transaction ID, SDK App ID, SDK reference number, SDK ephemeral public key and message version.

The host's 3DS Server submitted the AReq and interpreted the ARes. If the ACS returned a frictionless outcome, no challenge UI was needed. If the ARes mandated a challenge, the app called doChallenge with the 3DS Server transaction ID, ACS transaction ID, ACS reference number and ACS signed content.

Only one active standalone service was allowed at a time. Explicit close and cleanup operations released transaction state and made the next flow possible. This avoided hidden concurrency and made the lifecycle part of the integration contract.

Managed and standalone mobile 3DS integration A side-by-side comparison of a managed session integration and a standalone mobile 3DS SDK integration, including orchestration, AReq and ARes ownership, challenge execution, and cleanup. Managed and standalone mobile 3DS integration Two delivery modes, one standards-based challenge engine Managed session The platform directs the next action; the SDK executes it. Standalone session The host owns orchestration and remains provider-agnostic. 1 Create or resume the session Host app supplies the session ID, secret, payment scheme, and context. 2 Follow the server-directed next action Collect and encrypt device data, continue frictionless processing, start a challenge, or handle an optional 3DS1 fallback. 3 Run the native challenge when requested Validate signed parameters, then exchange encrypted CReq / CRes. 4 Complete and clean up Return the final state and release transaction-scoped resources. Platform-managed orchestration 1 Initialize the SDK with scheme configuration DS ID, public key, root certificates, protocol version, locale, and challenge UI settings. 2 Build the AReq inputs SDK returns encrypted device data and transaction parameters. 3 Host backend owns AReq and ARes The 3DS Server communicates with the DS and issuer ACS. 4 Call doChallenge only when ARes requires it Run the challenge, return the outcome, then close and clean up. Provider-agnostic orchestration Shared native challenge engine Signed-content validation → encrypted CReq / CRes → native challenge UI → transaction cleanup
Managed sessions keep orchestration on the platform side; standalone sessions give the integrator control of its 3DS Server and provider while retaining the same ACS-facing mobile challenge responsibilities.
06

Implementing the ACS-facing challenge behaviour

The SDK did not implement the issuer's ACS server. It implemented the mobile behaviour required to communicate with an ACS safely and present its challenge to the cardholder.

The challenge sequence was explicit:

  1. Accept challenge parameters from the ARes. The SDK received the transaction identifiers, ACS reference number and signed ACS content through the host integration.
  2. Validate the ACS signed content. The JWS certificate chain and signature were checked against the supplied Directory Server root certificates before the ACS URL or ephemeral public key could be trusted.
  3. Establish transaction-specific cryptographic state. The SDK combined its ephemeral P-256 key with the ACS ephemeral public key to derive the shared challenge secret.
  4. Send the initial CReq. The request carried the 3DS Server, ACS and SDK transaction IDs, protocol version and SDK-to-ACS counter. Version-specific fields such as the requestor app URL and message extensions were added only where valid.
  5. Decrypt and validate the CRes. The SDK checked message type, version, identifiers, ACS-to-SDK counter, completion indicator, transaction status, critical extensions and conditional fields for the selected UI type.
  6. Render the ACS instruction natively. Supported templates covered text or OTP entry, single selection, multiple selection, out-of-band authentication and HTML challenges.
  7. Continue the CReq/CRes loop. Cardholder submission, resend, HTML data, OOB continuation, cancellation, no-entry and trust-list choices became structured follow-up CReq messages.
  8. Finish or report an error. Completion returned the transaction status to the host. Invalid protocol data and timeouts generated the applicable EMV 3DS Erro path, and transaction state was then cleared.

The UI layer preserved ACS-provided content such as challenge headings, explanatory text, issuer and payment-system imagery, resend labels, expand or “why” information and trust-list prompts. It also handled the difference between an in-app challenge and an OOB journey in which the cardholder temporarily moves to an issuer application and returns through an app or universal link.

The result was not merely an embedded web page. It was a protocol-aware native state machine that connected cryptography, networking, lifecycle events and cardholder interaction.

07

Cryptography across the Directory Server and ACS channels

The security architecture used separate cryptographic stages for device information and the live challenge.

Encrypting device information for the Directory Server

The SDK collected the device information defined for an app-based 3DS flow, including platform, OS, locale, time zone, screen and application context. It also recorded unavailable parameters and runtime security warnings rather than fabricating values.

That payload became SDK Encrypted Data for the AReq. EMVCo describes the same model: the SDK collects data through operating-system APIs, encrypts it with the Directory Server public key and passes it to the 3DS Server for inclusion in the AReq.

The implementation supported two Directory Server key types:

  • With an EC public key, the SDK generated a fresh P-256 key pair, used ECDH-ES to establish key material, applied a SHA-256 JOSE Concat KDF and produced compact JWE using A128CBC-HS256.
  • With an RSA public key, it used RSA-OAEP-256 for key management and A128CBC-HS256 for content encryption.

These identifiers and their key-management rules are defined in the IETF's JSON Web Algorithms specification; the compact encrypted-message structure is defined by JSON Web Encryption.

Establishing trust in ACS data

The ACS signed content arrived as JWS with an X.509 certificate chain. The SDK built a trust path to a configured Directory Server root, validated the signature and then extracted the ACS URL and ephemeral public key.

The two native implementations supported EC and RSA signature families through ES256 and PS256, with the Android validator also accepting RS256. This follows the separation between JWS signatures and certificate-chain headers and PKIX certificate-path validation.

Protecting the live CReq/CRes exchange

The SDK and ACS derived a shared secret from transaction-specific EC keys. Challenge messages were compact JWE, with strict handling for Base64URL form, counters, identifiers and protocol versions. The common cross-platform path used A128CBC-HS256; Android also included an A128GCM challenge-channel path.

The cryptographic state was tied to one transaction. A new SDK transaction ID and ephemeral key were created for a new flow, and the derived material was cleared on completion or cleanup. This limited the value and lifetime of any in-memory secret.

Cryptographic lifecycle inside the mobile 3DS SDK A seven-step technical flow showing device data collection, ephemeral key generation, Directory Server encryption, ACS signature validation, ECDH secret derivation, encrypted CReq and CRes challenge messages, and secure cleanup. Cryptographic lifecycle inside the mobile 3DS SDK Per-transaction protection from device data to challenge cleanup BEFORE THE CHALLENGE: DEVICE DATA AND DIRECTORY SERVER PROTECTION CHALLENGE TRUST SETUP 1 Collect and generate Device and app data SDK transaction ID Ephemeral P-256 key pair New cryptographic context per transaction 2 Protect for the DS EC key: ECDH-ES with SHA-256 Concat KDF or RSA-OAEP-256 depending on the configured DS key 3 Create SDK Encrypted Data JWE content encryption A128CBC-HS256 The encrypted payload is supplied to the Authentication Request (AReq). 4 Validate the ACS JWS signature validation X.509 / PKIX chain validation ES256 / PS256 Android also accepts the RS256 path. CHALLENGE CHANNEL: SHARED SECRET, ENCRYPTED MESSAGES, AND CLEANUP 5 Derive the shared secret SDK ephemeral P-256 key + ACS ephemeral P-256 key ECDH shared secret Used only for the challenge transaction 6 Protect CReq and CRes Compact JWE challenge messages Common: A128CBC-HS256 Android also supports an A128GCM path. Counters and transaction IDs bind state. 7 Finish securely Clear ephemeral keys Clear counters and transaction state Close session resources No challenge secrets survive the session Trust checks use configured Directory Server keys and validated ACS certificate material.
The transaction cryptographic lifecycle separates Directory Server device-data encryption, ACS trust validation, ECDH secret derivation, encrypted challenge messages and cleanup.
08

Secure storage: persist the minimum, clear the rest

The SDK separated a stable installation identifier from transaction-specific secrets.

DataAndroidiOSLifecycle
SDK App IDPrivate SharedPreferences encrypted with an Android Keystore-backed AES-256 keyApple KeychainPersisted as the SDK installation identity; regenerated by the applicable installation or version lifecycle.
Session IDs and secretsRuntime stateRuntime stateRemoved when the flow completes, fails or is cleaned up.
Ephemeral EC key and derived secretRuntime cryptographic contextRuntime cryptographic contextCreated for the transaction and cleared through close / cleanup paths.
Cardholder challenge inputTransient request stateTransient request stateSent to the ACS when required; not part of persistent SDK storage.

On Android API 23 and later, the persistent identifier used AES-GCM with a 256-bit Keystore key, a fresh 12-byte IV and a 128-bit authentication tag. A legacy compatibility path for older Android versions used an RSA key pair in Android Keystore to wrap an AES-256 key, with the minimal stored value encrypted using AES-CBC.

On iOS, Keychain stored the SDK App ID while UserDefaults held only the fresh-install marker used by the identifier lifecycle. Session tracking remained in memory, and the ECDH secret was set to nil when authentication or cleanup finished.

This is the practical storage rule for a payment SDK: persist only what the protocol requires across sessions, use the platform security service, prefer authenticated encryption, and keep session secrets, ephemeral keys and cardholder responses out of long-lived storage. The Android Keystore, Apple Keychain and OWASP MASVS storage and cryptography controls provide the platform and industry context for those choices.

09

Hardening distributable SDK binaries with DexProtector

A widely distributed SDK has a different attack surface from a closed first-party application. An attacker can obtain the binary, inspect it repeatedly and compare multiple versions. AirisApps therefore treated release hardening as part of the SDK build, not as a host-app concern left to every integrator.

The Android release AAR combined code shrinking and obfuscation with DexProtector. Its production configuration applied string encryption to SDK code, class encryption around cryptographic and session-sensitive areas, native class encryption, hidden access for selected calls, anti-manual-install checks and anti-Xposed protection.

The iOS pipeline produced a protected XCFramework and companion security framework. Its configuration encrypted strings and Swift / Objective-C class metadata, protected simulator slices and enabled Swift environment checks.

Both SDKs surfaced runtime warnings to the integrating application. The warning model covered rooted or jailbroken devices, emulators or simulators, attached debuggers, integrity modification, manual installation and instrumentation frameworks such as Frida or Xposed. Reporting mode was deliberate: a security signal could inform policy and telemetry without making an isolated client-side check the final authorization decision.

Licel documents these controls as code protection, integrity checking and Runtime Application Self-Protection for Android apps and SDKs and iOS frameworks and XCFrameworks. In this architecture they remained defense in depth; backend authentication and authorization still had to treat the mobile client as an untrusted environment.

10

Native SDK architecture without forcing both platforms into one shape

Android and iOS shared the same protocol responsibilities and outcome model, but each SDK used native platform patterns.

PlatformArchitecture and UISecurity and networkingDistribution
AndroidKotlin and Java, Android Views / XML, ViewModel and LiveData, Coroutines, layered domain, data and UI modulesRetrofit, OkHttp, Gson, Nimbus JOSE + JWT, Bouncy / Spongy Castle, Certificate Transparency and Android KeystoreGradle, AAR, Maven publishing and consumer ProGuard rules
iOSSwift with Objective-C interoperability, UIKit, factories and service / requester boundariesURLSession, Apple Security framework, CommonCrypto, JOSESwift and KeychainCocoaPods-compatible integration and distributable XCFrameworks

The codebases applied clean-architecture principles through explicit public contracts, domain orchestration, protocol models, data mappers, networking, cryptography, storage and UI boundaries. This made the complex paths testable without placing protocol details in view controllers or host-app integration code.

Native UI also made accessibility, localization and visual customization part of the SDK product. Integrators could adapt typography, colours, buttons, toolbars and translated strings while the SDK retained control of protocol-valid behaviour.

11

Testing the state machine, not only the happy path

The test strategy followed the risk profile of a distributed authentication SDK.

Unit tests covered ECDH and RSA encryption paths, JWE and JWS processing, certificate validation, secure storage, counters, transaction identifiers, protocol versions and conditional CRes fields. Negative cases included malformed JOSE payloads, invalid Base64URL input, mismatched IDs, unsupported UI data and timeouts.

Integration tests exercised session APIs and ACS communication against controlled responses. UI and end-to-end flow tests covered text, selection, HTML and OOB challenges, including resend, cancel and return-to-app behaviour.

The Android stack used JUnit, MockK, Robolectric, MockWebServer, Espresso and Cucumber. The iOS stack used XCTest, XCUITest and CucumberSwift. CI pipelines ran native builds, unit tests and simulator or emulator UI tests, with linting, code coverage, static analysis, CodeQL and artifact production around them.

Dedicated EMVCo / UL-oriented reference harnesses supported protocol and real-device conformance scenarios. That demonstrates certification-ready engineering discipline, but it is not presented here as a claim of current EMVCo or PCI listing status. The relevant product-class security requirements are described by the PCI 3DS SDK programme.

12

The outcome: one mobile trust layer, reusable across applications

The completed Android and iOS SDKs gave downstream product teams a consistent way to add EMV 3DS authentication without rebuilding device-data collection, cryptography, issuer challenge UI and protocol error handling inside every app.

The managed flow reduced integration effort for teams using the partner's session platform. The standalone flow preserved provider choice for organizations with another 3DS Server. Both routes converged on the same hardened native challenge engine and the same lifecycle discipline.

For the fintech platform, this created a reusable product layer that could evolve independently of its many host applications. For integrators, it provided stable APIs, native customization, clear outcomes and a smaller surface on which to make security-critical mistakes.

For AirisApps, the engagement demonstrates end-to-end secure mobile SDK development: translating a payment standard into native products, building cryptographic and ACS-facing behaviour, packaging security controls into release artifacts and sustaining the testing system required for production distribution.

13

Questions fintech leaders ask about mobile 3DS SDKs

Is 3DS the same as payment authorization?

No. EMV 3DS authenticates the cardholder and returns an authentication result. The payment authorization that decides whether funds can be approved is a separate step. A dependable SDK must preserve that boundary instead of presenting every successful challenge as a successful payment.

What is the difference between a frictionless flow and a challenge flow?

In a frictionless flow, the ACS considers the available device, transaction and risk context sufficient and no cardholder interaction is required. In a challenge flow, the ACS asks for additional evidence through an OTP, selection, or an issuer-app approval that may use biometrics. The mobile SDK owns the secure app-based challenge channel and presentation—not the issuer's risk decision.

Does standalone 3DS mean there is no backend or 3DS Server?

No. A standalone SDK gives the integrator control over its provider and AReq / ARes orchestration. It still depends on a 3DS Requestor, 3DS Server, Directory Server and ACS. The value is provider choice and a clearer integration boundary, not removal of the server-side protocol.

Does a 3DS SDK guarantee PSD2 compliance or liability shift?

No SDK can make that guarantee in isolation. EMV 3DS can support PSD2 SCA and may be relevant to payment-scheme liability allocation, but the result depends on the complete authentication and authorization flow, the parties involved, applicable exemptions, transaction outcome, region and scheme rules. The SDK supplies the security-critical mobile component within that wider system.

A 3DS SDK is therefore not a thin wrapper around an endpoint. It is a distributed protocol component, a native user experience, a cryptographic boundary and a product consumed by other engineering teams.

14

Build a secure 3DS mobile SDK without pushing protocol complexity into every app

AirisApps brings native Android and iOS engineering, mobile security, SDK architecture, automated testing and production delivery into one accountable scope.

If you are building or modernizing an EMV 3DS SDK, payment-authentication layer or security-sensitive fintech integration, start a conversation with AirisApps.

Related work: Explore how AirisApps delivered native mobile banking and strong customer authentication.