~ubuntu-branches/ubuntu/precise/trousers/precise-proposed

« back to all changes in this revision

Viewing changes to man/man3/Tspi_Context_UnregisterKey.3

  • Committer: Bazaar Package Importer
  • Author(s): William Lima
  • Date: 2007-04-18 16:39:38 UTC
  • Revision ID: james.westby@ubuntu.com-20070418163938-opscl2mvvi76jiec
Tags: upstream-0.2.9.1
ImportĀ upstreamĀ versionĀ 0.2.9.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
3
.\"
 
4
.de Sh \" Subsection
 
5
.br
 
6
.if t .Sp
 
7
.ne 5
 
8
.PP
 
9
\fB\\$1\fR
 
10
.PP
 
11
..
 
12
.de Sp \" Vertical space (when we can't use .PP)
 
13
.if t .sp .5v
 
14
.if n .sp
 
15
..
 
16
.de Ip \" List item
 
17
.br
 
18
.ie \\n(.$>=3 .ne \\$3
 
19
.el .ne 3
 
20
.IP "\\$1" \\$2
 
21
..
 
22
.TH "Tspi_Context_UnregisterKey" 3 "2004-05-26" "TSS 1.1" "TCG Software Stack Developer's Reference"
 
23
.SH NAME
 
24
Tspi_Context_UnregisterKey \- unregister a key from the persistent storage device.
 
25
.SH "SYNOPSIS"
 
26
.ad l
 
27
.hy 0
 
28
.nf
 
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>
 
36
.sp
 
37
.BI "TSS_RESULT Tspi_Context_UnregisterKey(TSS_HCONTEXT " hContext ", TSS_FLAG  " persistentStorageType ","
 
38
.BI "                                      TSS_UUID     " uuidKey ",  TSS_HKEY* " phKey ");"
 
39
.fi
 
40
.sp
 
41
.ad
 
42
.hy
 
43
 
 
44
.SH "DESCRIPTION"
 
45
.PP
 
46
\fBTSS_Context_UnregisterKey\fR  
 
47
provides the capabilities of the TSS Core Service or TSS Service Provider
 
48
.SH "PARAMETERS"
 
49
.PP
 
50
.SS hContext
 
51
The handle of the context object.
 
52
.PP
 
53
.SS persistentStorageType
 
54
Flag indicating the persistent storage.
 
55
.PP
 
56
.SS uuidKey
 
57
The UUID of the key to be removed from the persistent storage.
 
58
.PP
 
59
.SS phKey
 
60
Recieves the handle of a key object containing the information from the archive.
 
61
.PP
 
62
.SS pulRespDataLength
 
63
Recieves the length (in bytes) of the prgbRespData parameter.
 
64
.PP
 
65
.SS prgbRespData
 
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
 
68
 
 
69
.SH "RETURN CODES"
 
70
.PP
 
71
\fBTspi_Context_UnregisterKey\fR returns TSS_SUCCESS on success, otherwise one of the following values are returned:
 
72
.TP
 
73
.SM TSS_E_INVALID_HANDLE - the parameter \fIhContext\fR is an invalid parameter.
 
74
.TP
 
75
.SM TSS_E_PS_KEY_NOTFOUND - the parameter \fIuuidKey\fR is an invalid UUID.
 
76
.TP
 
77
.SM TSS_E_INTERNAL_ERROR - An error occurred internal to the TSS.
 
78
.SH "EXAMPLE"
 
79
.nf
 
80
#include <trousers/tss.h>
 
81
 
 
82
int
 
83
main(void)
 
84
{
 
85
        TSS_FLAGS       initFlags = ...;
 
86
        TSS_HKEY        hKey, hSRK;
 
87
        TSS_UUID        keyUUID = {...};
 
88
 
 
89
        // Create a TSP handle
 
90
        result = Tspi_Context_Create(&hContext);
 
91
        if (result != TSS_SUCCESS)
 
92
                Error_Path();
 
93
 
 
94
        // Connect to the TCSD
 
95
        result = Tspi_Context_Connect(hContext, GLOBALSERVER);
 
96
        if (result != TSS_SUCCESS)
 
97
                Error_Path();
 
98
 
 
99
        // Create the Key Object
 
100
        result = Tspi_Context_CreateObject(hContext,
 
101
                        TSS_OBJECT_TYPE_RSAKEY,
 
102
                        initFlags, &hKey);
 
103
        if (result != TSS_SUCCESS)
 
104
                Error_Path();
 
105
 
 
106
        // Load parent Key by UUID
 
107
        result = Tspi_Context_LoadKeyByUUID(hContext, TSS_PS_TYPE_SYSTEM,
 
108
                        SRK_UUID, &hSRK);
 
109
        if (result != TSS_SUCCESS)
 
110
                Error_Path();
 
111
 
 
112
        // Do policy/secret handling here
 
113
 
 
114
        result = Tspi_Key_CreateKey(hKey, hSRK, 0);
 
115
        if (result != TSS_SUCCESS)
 
116
                Error_Path();
 
117
 
 
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,
 
121
                        SRK_UUID);
 
122
        if (result != TSS_SUCCESS)
 
123
                Error_Path();
 
124
 
 
125
        /* ...
 
126
         *
 
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
 
130
         * of clean up.
 
131
         */
 
132
 
 
133
        // Unregister the Key
 
134
        result = Tspi_Context_UnregisterKey(hContext, TSS_PS_TYPE_SYSTEM,
 
135
                        migratableSignUUID, &hKey);
 
136
        if (result != TSS_SUCCESS)
 
137
                Error_Path();
 
138
 
 
139
        // exit, discarding hKey
 
140
}
 
141
.fi
 
142
 
 
143
.SH "CONFORMING TO"
 
144
 
 
145
.PP
 
146
\fBTspi_Context_UnregisterKey\fR conforms to the Trusted Computing Group Software Specification version 1.1 Golden
 
147
.SH "SEE ALSO"
 
148
 
 
149
.PP
 
150
\fBTspi_Key_CreateKey\fR(3), \fBTspi_Context_RegisterKey\fR(3).