--- title: "AAL2MigrateBlobICSF" slug: "a3s-cppprg-icsf-zos-aal2migrateblobicsf-4-0" updated: 2026-11-11T09:57:24Z published: 2026-11-11T09:57:24Z canonical: "docs.onespan.com/a3s-cppprg-icsf-zos-aal2migrateblobicsf-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. # AAL2MigrateBlobICSF ## Function prototype (aal2sdk.h) ```cpp aat_int32 AAL2MigrateBlobICSF ( TDigipassBlob* DPBlob, TKernelParms* CallParms, aat_ascii* aOldStorageKeyName, aat_ascii* aOldInitialVector, aat_ascii* aNewStorageKeyName, aat_ascii* aNewInitialVector); ``` ## Description The BLOB migration function can be used to: 1. Convert a BLOB encrypted with a software storage key to a BLOB encrypted with an HSM storage key. (i.e. software --> HSM-encrypted) BLOB ready to be stored in the database. 2. Migrate an HSM storage key encrypted BLOB to a NEW HSM storage key encrypted BLOB. (i.e. HSM Storage Key 1 --> HSM Storage Key 2). You can acquire a software-encrypted BLOB using the Authentication Suite Server SDK API AAL2DPXGetTokenBlobsEx2(). This will extract a BLOB but not migrate it. ## Parameters > The memory management of the output parameters must be performed by the calling function. | Type | Name | Use | Description | | --- | --- | --- | --- | | TDigipassBlob * | DPBlob | I/O | authenticator application BLOB. | | TKernelParms * | CallParms | I | Structure of run time parameters to use during the HSM migrate BLOB function call. | | aat_ascii * | aOldStorageKeyName | I | String containing the HSM key label used to perform the decryption of the sensitive data of the BLOB in input. This is the label of the HSM storage key used to decrypt the BLOB in case of storage key migration. This parameter has to be set to blank (NULL) when migrating a software encrypted BLOB. | | aat_ascii * | aOldInitialVector | I | String containing the decryption initial vector to be used during the decryption of the BLOB in input. This parameter has to be set to blank when migrating a software encrypted BLOB. | | aat_ascii * | aNewStorageKeyName | I | String containing the HSM storage key used to perform the 3DES/AES encryption of the sensitive data of the BLOB in output. After migration, further usage of the authenticator application BLOB will mandatorily require to use this HSM storage key. | | aat_ascii * | aNewInitialVector | I | 16 or 32 hexadecimal containing the initial vector. This is the initial vector used to perform the encryption of the sensitive authenticator application BLOB data in output. Can be NULL to encrypt the BLOB without any initial vector. After migration, further usage of the authenticator application BLOB will mandatorily require to use this initial vector. | ## COBOL calling convention ```custom Entry point: AA2MGBIC 02 W-BLOB PIC X(248). 02 W-KERNELPARMS. 03 W-PARMCOUNT PIC 9(8) USAGE BINARY. 03 W-PARM01 PIC 9(8) USAGE BINARY. . . . 03 W-PARM19 PIC 9(8) USAGE BINARY. 02 W-RETURN PIC S9(8) USAGE BINARY. 02 W-OLDSTORAGEKEY PIC X(65). 02 W-OLDINITVECTOR PIC X(17). 02 W-NEWSTORAGEKEY PIC X(65). 02 W-NEWINITVECTOR PIC X(17). 02 W-API-NAME PIC X(8) VALUE 'AA2MGBIC'. . . . CALL W-API-NAME USING BY REFERENCE W-BLOB BY REFERENCE W-KERNELPARMS BY REFERENCE W-OLDSTORAGEKEY BY REFERENCE W-OLDINITVECTOR BY REFERENCE W-NEWSTORAGEKEY BY REFERENCE W-NEWINITVECTOR RETURNING W-RETURN ``` ## Return codes | Code | Meaning | Code | Meaning | | --- | --- | --- | --- | | 0 | Success | 908 | HSM key not found | | 412 | Invalid checksum (software) | 950 | Invalid application for AES HSM encryption | | 413 | Invalid Base64 format | 951 | Invalid HSM key type for HSM decryption | | 414 | Invalid checksum (HSM) | 1100 | Function not supported | | 510 | Invalid Digipass data pointer | 1118 | Unsupported BLOB | | 900 | Invalid session context handle | | |