---
name: "Tspi_Context_Create"
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_Context_Create"
---

# Tspi\_Context\_Create(3)

create a TSP context handle.

## NAME

Tspi\_Context\_Create - create a TSP context handle.

## 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\_Context\_Create(TSS\_HCONTEXT\*** *phContext***);**

## DESCRIPTION

**Tspi\_Context\_Create** creates a handle to a new context object. The context is then used by other API functions to track resources related to it.

## PARAMETERS

### phContext

Receives the handle to the created context object.

## RETURN CODES

**Tspi\_Context\_Create** returns TSS\_SUCCESS on success, otherwise one of the following values are returned: TSS\_E\_INTERNAL\_ERROR - An internal error occurred in the TSS.

## CONFORMING TO

**Tspi\_Context\_Create** conforms to the Trusted Computing Group Software Specification version 1.1 Golden

## SEE ALSO

[**Tspi\_Context\_Close**(3)](/Tspi_Context_Close/3.md), [**Tspi\_Context\_Connect**(3)](/Tspi_Context_Connect/3.md).
