---
name: "Tspi_Key_CreateMigrationBlob"
section: "3"
platform: "linux"
package: "libtspi-dev"
version: "0.3.15-0.4"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Tspi_Key_CreateMigrationBlob"
---

# Tspi\_Key\_CreateMigrationBlob(3)

create a key blob suitable for migrating to another TPM.

## NAME

Tspi\_Key\_CreateMigrationBlob - create a key blob suitable for migrating to another TPM.

## SYNOPSIS

**#include \<tss/platform.h\>** **#include \<tss/tcpa\_defines.h\>** **#include \<tss/tcpa\_typedef.h\>** **#include \<tss/tcpa\_struct.h\>** **#include \<tss/tss\_typedef.h\>** **#include \<tss/tss\_structs.h\>** **#include \<tss/tspi.h\>** **TSS\_RESULT Tspi\_Key\_CreateMigrationBlob(TSS\_HKEY** *hKeyToMigrate***,          TSS\_HKEY** *hParentKey***,**                                         **UINT32**   *ulMigTicketLength***,      BYTE\***    *rgbMigTicket***,**                                         **UINT32\***  *pulRandomLength***,        BYTE\*\***   *prgbRandom***,**                                         **UINT32\***  *pulMigrationBlobLength***, BYTE\*\***   *prgbMigrationBlob***);**

## DESCRIPTION

**Tspi\_Key\_CreateMigrationBlob** returns a key blob containing an encrypted section, which will be different depending on the migration scheme indicated within the migration ticket previously created by the method Tspi\_TPM\_AuthorizeMigrationTicket().

## PARAMETERS

### hKeyToMigrate

Handle of the key object to migrate.

### hParentKey

Handle to the parent key related to the key addressed by hKeyToMigrate.

### ulMigTicketLength

The length (in bytes) of the rgbMigTickey parameter.

### rgbMigTicket

Pointer to memory containing the migration ticket (migration public key and its authorization digest).

### pulRandomLength

On successful completion this parameter returns the random data length returned at the parameter prgbRandom.

### prgbRandom

On successful completion this parameter returns the random data.

### pulMigrationBlobLength

On successful completion this parameter returns the length of the migration blob data returned at the parameter prgbMigrationBlob.

### prgbMigrationBlob

On successful completion this parameter returns the migration data blob.

## RETURN CODES

**Tspi\_Key\_CreateMigrationBlob** returns TSS\_SUCCESS on success, otherwise one of the following values are returned: TSS\_E\_INVALID\_HANDLE - Either *hKeyToMigrate*, *hParentKey* or *rgbMigTicket* are invalid parameters. TSS\_E\_BAD\_PARAMETER - One of the passed parameters is wrong.  TSS\_E\_KEY\_NO\_MIGRATION\_POLICY - No migration policy picked. TSS\_E\_INTERNAL\_ERROR - An error occurred internal to the TSS.

## CONFORMING TO

**Tspi\_Key\_CreateMigrationBlob** conforms to the Trusted Computing Group Software Specification version 1.1 Golden

## SEE ALSO

[**Tspi\_Key\_CreateKey**(3)](/Tspi_Key_CreateKey/3.md), [**Tspi\_Key\_CertifyKey**(3)](/Tspi_Key_CertifyKey/3.md).
