author yamt <>
Tue, 17 Apr 2012 00:01:34 +0000
changeset 280360 e98874280705
permissions -rw-r--r--
sync with head

.\" Copyright (C) 2004 International Business Machines Corporation
.\" Written by Kathy Robertson based on the Trusted Computing Group Software Stack Specification Version 1.1 Golden
.de Sh \" Subsection
.if t .Sp
.ne 5
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
.de Ip \" List item
.ie \\n(.$>=3 .ne \\$3
.el .ne 3
.IP "\\$1" \\$2
.TH "Tspi_Context_CreateObject" 3 "2004-05-26" "TSS 1.1" "TCG Software Stack Developer's Reference"
Tspi_Context_CreateObject \- create an empty object and return a handle to that object.
.ad l
.hy 0
.B #include <tss/platform.h>
.B #include <tss/tcpa_defines.h>
.B #include <tss/tcpa_typedef.h>
.B #include <tss/tcpa_struct.h>
.B #include <tss/tss_typedef.h>
.B #include <tss/tss_structs.h>
.B #include <tss/tspi.h>
.BI "TSS_RESULT Tspi_Context_CreateObject(TSS_HCONTEXT " hContext ",  TSS_FLAG     " objectType ","
.BI "                                     TSS_FLAG     " initFlags ", TSS_HOBJECT* " phObject ");"
\fBTSS_Context_CreateObject\fR creates and initializes an empty object of the specified type and returns a handle addressing that object. The object is bound to an already opened context \fIhContext\fR.
.SS hContext
The handle of the context object.
.SS objectType
Flag indicating the object type to create. Possible types are:
.SM TSS_OBJECT_TYPE_POLICY - a policy object.
.SM TSS_OBJECT_TYPE_ENCDATA - an encrypted data object (either sealed or bound data).
.SM TSS_OBJECT_TYPE_PCRS - a PCR composite object.
.SM TSS_OBJECT_TYPE_HASH - a hash object.
.SS initFlags
Flag indicating the default attributes of the object. Attributes for each type of object are:
.SM Policy:
 \fBTSS_POLICY_USAGE\fR - a usage policy (for authorization to use an object).
 \fBTSS_POLICY_MIGRATION\fR - a migration policy.
.SM Encrypted data objects:
 \fBTSS_ENCDATA_SEAL\fR - A data object used for a Seal operation.
 \fBTSS_ENCDATA_BIND\fR - A data object used for a Bind operation.
 \fBTSS_ENCDATA_LEGACY\fR - A data object for a bind operation using a legacy key.
.SM RSA Keys:
 \fBTSS_KEY_SIZE_DEFAULT\fR - Use the default key size of the TCS you're connected to.
 \fBTSS_KEY_SIZE_512\fR - Create a 512 bit key.
 \fBTSS_KEY_SIZE_1024\fR - Create a 1024 bit key.
 \fBTSS_KEY_SIZE_2048\fR - Create a 2048 bit key.
 \fBTSS_KEY_SIZE_4096\fR - Create a 4096 bit key.
 \fBTSS_KEY_SIZE_8192\fR - Create a 8192 bit key.
 \fBTSS_KEY_SIZE_16384\fR - Create a 16384 bit key.
 \fBTSS_KEY_TYPE_STORAGE\fR - Create a storage key. (Used to wrap other keys).
 \fBTSS_KEY_TYPE_SIGNING\fR - Create a signing key.
 \fBTSS_KEY_TYPE_BIND\fR - Create a binding key. (Used to encrypt data).
 \fBTSS_KEY_TYPE_IDENTITY\fR - Create an identity key. (Used for an identity).
 \fBTSS_KEY_TYPE_LEGACY\fR - Create a legacy key. (Can be used for signing and binding, created from data external to a TSS).
 \fBTSS_KEY_TYPE_AUTHCHANGE\fR - Create an ephemeral key used to change authorization values.
 \fBTSS_KEY_VOLATILE\fR - Create a volatile key. (Must be unloaded at startup).
 \fBTSS_KEY_NON_VOLATILE\fR - Create a non-volatile key. (May be unloaded at startup).
 \fBTSS_KEY_MIGRATABLE\fR - Create a migratable key.
 \fBTSS_KEY_NOT_MIGRATABLE\fR - Create a non-migratable key. [DEFAULT]
 \fBTSS_KEY_AUTHORIZATION\fR - Key will require authorization.
 \fBTSS_KEY_NO_AUTHORIZATION\fR - Key will not require authorization. [DEFAULT]
 \fBTSS_KEY_EMPTY_KEY\fR - Key template which will be returned as an object with very few attributes.

.SM PCR composite objects:
.SM Hash objects:
 \fBTSS_HASH_SHA1\fR - a hash object of type SHA-1.
 \fBTSS_HASH_OTHER\fR - a hash object of type other than SHA-1.
.SS phObject
The handle of the object to be created.

\fBTspi_Context_CreateObject\fR returns TSS_SUCCESS on success, otherwise one of the following values are returned:
.SM TSS_E_INVALID_HANDLE - Either \fIhContext\fR or \fIphObject\fR is an invalid handle. 
.SM TSS_E_INTERNAL_ERROR - An error occurred internal to the TSS.


\fBTspi_Context_CreateObject\fR conforms to the Trusted Computing Group Software Specification version 1.1 Golden