--- title: "AAL2GenQAKey" slug: "a3s-cppprg-aal2genqakey-4-0" updated: 2026-11-11T10:00:40Z published: 2026-11-11T10:00:40Z canonical: "docs.onespan.com/a3s-cppprg-aal2genqakey-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. # AAL2GenQAKey ## Function prototype ```cpp aat_int32 AAL2GenQAKey (aat_ascii*      aQAIndexList,                         aat_ascii*      aQAHashData,                         aat_ascii*      aUserID,                         aat_ascii*      aQAKey[32+1]); ``` ## Description This function generates a QA key for AAL2GenActivationCodeEx based on two lists of indexes and their matching hashes, and the QA key user ID owner. ## Parameters | Type | Name | Use | Description | | --- | --- | --- | --- | | aat_ascii * | aQAIndexList | I | List of the question index on two randomly chosen characters. | | aat_ascii * | aQAHash Data | I | List of matching answer hashes on 30 characters. | | aat_ascii * | aUserId | I | ID of the QAKey owner. | | aat_ascii [32+1] | aQAKey | O | Key on 32 characters calculated from the answer hash of the user. This key will be used to encrypt the activation data. The key is null-terminated. | ## Return codes | Code | Meaning | Code | Meaning | | --- | --- | --- | --- | | 0 | Success | 541 | Invalid index list | | 533 | Invalid UserId pointer | 542 | Invalid hash list | | 540 | Invalid QAkey pointer | -1501 | Memory allocation failed |