--- title: "AAL2GenPassword" slug: "a3s-cppprg-aal2genpassword-4-0" updated: 2026-11-11T10:00:40Z published: 2026-11-11T10:00:40Z canonical: "docs.onespan.com/a3s-cppprg-aal2genpassword-4-0" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.onespan.com/llms.txt > Use this file to discover all available pages before exploring further. # AAL2GenPassword ## Function prototype ```cpp aat_int32 AAL2GenPassword( TDigipassBlob*   DPData,                            TKernelParms*    CallParms,                            aat_ascii*       Password,                            aat_ascii*       Challenge); ``` ## Description If Virtual Mobile Authenticator is supported and activated for the given Digipass application BLOB, this function can be used to generate a dynamic one-time password. ## Parameters | Type | Name | Use | Description | | --- | --- | --- | --- | | TDigipassBlob * | DPData | I/O | authenticator application BLOB. Upon return from the function call, this BLOB must be rewritten to the application database to reflect changes.. | | TKernelParms * | CallParms | I | Structure of runtime parameters to use during this function call. | | aat_ascii * | Password | O | String of up to 17 numeric or hexadecimal characters, left-justified, null-terminated, or right-padded with spaces. This is the dynamic password generated by the library (recommended buffer size is 18 bytes). | | aat_ascii * | Challenge | I | String of up to 17 numeric characters, left-justified, null-terminated, or right-padded with spaces. This parameter holds the challenge which may have been proposed to the user to generate CodeToVerify. If no challenge was generated, this parameter should be NULL. | ## Return codes | Code | Meaning | Code | Meaning | | --- | --- | --- | --- | | 0 | Success | 1103 | Unlock Version 2 not supported | | 130 | Invalid response pointer | 1116 | Response check digit not allowed | | 131 | Missing required challenge | 1117 | Challenge check digit not allowed | | 132 | Unsupported token type | 1118 | Unsupported BLOB | | 202 | Identification error threshold reached | -101 | Challenge too short | | 208 | Application disabled | -102 | Challenge too long | | 209 | Grace period expired | -103 | Challenge check digit wrong | | 210 | Allowed use count reached | -105 | Challenge minimum length not allowed | | 211 | Virtual Virtual token not supported | -106 | Challenge maximum length not allowed | | 412 | Invalid checksum | -107 | Challenge number wrong | | 413 | Invalid Base64 format | -108 | Challenge character invalid | | 510 | Invalid Digipass data pointer | -1501 | Memory allocation failed |