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 Megan Schneider 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_Data_Bind" 3 "2004-05-25" "TSS 1.1"
.ce 1
TCG Software Stack Developer's Reference
Tspi_Data_Bind \- Encrypts a data blob
.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_Data_Bind(TSS_HENCDATA " hEncData ",     TSS_HKEY " hEncKey ","
.BI "                          UINT32       " ulDataLength ", BYTE*    " rgbDataToBind ");"

\fBTspi_Data_Bind\fR encrypts a data blob in a manner
that is decryptable by \fBTspi_Data_Unbind\fR. The data blob is
encrypted using a public key operation with the key addressed by the
given encryption key object. To bind data that is larger than the RSA
public key modulus is the responsibility of the caller to perform the
blocking and subsequent combination of data. The bound data blob is
stored in the data object addressed by \fIhEncData\fR and can be
exported from the object by \fBTspi_GetAttribData\fR. The caller of
this function should perform validations that the public key presented
to it is from a valid TPM.

.SS hEncData
The handle of the data object which contains the encrypted data on
successful completion of the command.
.SS hEncKey
Handle to the key object addressing the public key which is used
to encrypt the data.
.SS ulDataLength
Indicates the length of the data provided at the parameter \fIrgbDataToBind\fR.
.SS rgbDataToBind
A pointer to the data to be encrypted.

\fBTspi_Data_Bind\fR returns TSS_SUCCESS on success, otherwise one of
the following values is returned:
\fIhHash\fR is not a valid handle.

An internal SW error has been detected.

One or more parameters is bad.

Invalid encryption scheme.

Invalid length of data to be encypted.

No data to encrypt.

Invalid encryption type.


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


\fBTspi_Data_Unbind\fR(3), \fBTspi_Data_Unseal\fR(3),