1
.\" Copyright (C) 2004 International Business Machines Corporation
2
.\" Written by Kathy Robertson based on the Trusted Computing Group Software Stack Specification Version 1.1 Golden
12
.de Sp \" Vertical space (when we can't use .PP)
18
.ie \\n(.$>=3 .ne \\$3
22
.TH "Tspi_Context_UnregisterKey" 3 "2004-05-26" "TSS 1.1" "TCG Software Stack Developer's Reference"
24
Tspi_Context_UnregisterKey \- unregister a key from the persistent storage device.
29
.B #include <tss/platform.h>
30
.B #include <tss/tcpa_defines.h>
31
.B #include <tss/tcpa_typedef.h>
32
.B #include <tss/tcpa_struct.h>
33
.B #include <tss/tss_typedef.h>
34
.B #include <tss/tss_structs.h>
35
.B #include <tss/tspi.h>
37
.BI "TSS_RESULT Tspi_Context_UnregisterKey(TSS_HCONTEXT " hContext ", TSS_FLAG " persistentStorageType ","
38
.BI " TSS_UUID " uuidKey ", TSS_HKEY* " phKey ");"
46
\fBTSS_Context_UnregisterKey\fR
47
provides the capabilities of the TSS Core Service or TSS Service Provider
51
The handle of the context object.
53
.SS persistentStorageType
54
Flag indicating the persistent storage.
57
The UUID of the key to be removed from the persistent storage.
60
Recieves the handle of a key object containing the information from the archive.
63
Recieves the length (in bytes) of the prgbRespData parameter.
66
On successful completion of the command, this parameter points to the buffer containing the actual data of the specified capability.
67
The handle of the object to be destroyed
71
\fBTspi_Context_UnregisterKey\fR returns TSS_SUCCESS on success, otherwise one of the following values are returned:
73
.SM TSS_E_INVALID_HANDLE - the parameter \fIhContext\fR is an invalid parameter.
75
.SM TSS_E_PS_KEY_NOTFOUND - the parameter \fIuuidKey\fR is an invalid UUID.
77
.SM TSS_E_INTERNAL_ERROR - An error occurred internal to the TSS.
80
#include <trousers/tss.h>
85
TSS_FLAGS initFlags = ...;
87
TSS_UUID keyUUID = {...};
89
// Create a TSP handle
90
result = Tspi_Context_Create(&hContext);
91
if (result != TSS_SUCCESS)
94
// Connect to the TCSD
95
result = Tspi_Context_Connect(hContext, GLOBALSERVER);
96
if (result != TSS_SUCCESS)
99
// Create the Key Object
100
result = Tspi_Context_CreateObject(hContext,
101
TSS_OBJECT_TYPE_RSAKEY,
103
if (result != TSS_SUCCESS)
106
// Load parent Key by UUID
107
result = Tspi_Context_LoadKeyByUUID(hContext, TSS_PS_TYPE_SYSTEM,
109
if (result != TSS_SUCCESS)
112
// Do policy/secret handling here
114
result = Tspi_Key_CreateKey(hKey, hSRK, 0);
115
if (result != TSS_SUCCESS)
118
// Register the Key in System PS (on the TCSD's platform)
119
result = Tspi_Context_RegisterKey(hContext, hKey, TSS_PS_TYPE_SYSTEM,
120
keyUUID, TSS_PS_TYPE_SYSTEM,
122
if (result != TSS_SUCCESS)
127
* Use the key as needed, exiting the program if necessary, reloading
128
* the key using Tspi_Context_LoadKeyByUUID() after each restart. Once
129
* the key is no longer useful, unregister it from system PS as part
133
// Unregister the Key
134
result = Tspi_Context_UnregisterKey(hContext, TSS_PS_TYPE_SYSTEM,
135
migratableSignUUID, &hKey);
136
if (result != TSS_SUCCESS)
139
// exit, discarding hKey
146
\fBTspi_Context_UnregisterKey\fR conforms to the Trusted Computing Group Software Specification version 1.1 Golden
150
\fBTspi_Key_CreateKey\fR(3), \fBTspi_Context_RegisterKey\fR(3).