tpm_createwrapkey.3

来自「IBM开发的TPM的驱动, 有少量的例子可以供参考」· 3 代码 · 共 116 行

3
116
字号
.\" Copyright 2004 IBM (Jeff Kravitz).\".\" Written Jan 29 2004, Jeff Kravitz.\".TH "TPM_CreateWrapKey" 3  2004-02-11 "IBM" "TPM Library".SH NAMETPM_CreateWrapKey.SH SYNOPSIS.nf.B #include <tpmfunc.h>.sp.BR "uint32_t TPM_CreateWrapKey" "(uint32_t parhandle,"                  unsigned char *parauth,                   unsigned char *keyauth,                  unsigned char *migauth,                  keydata *keyparms,keydata *newkey,                  unsigned char *keyblob,                  unsigned int *bloblen).fi.SH DESCRIPTIONThe \fBTPM_CreateWrapKey()\fP function generates a new key and returnsthe resulting key, wrapped (encrypted) by a parent key, for external storage..SH ARGUMENTSThe arguments include....TP 10.B parhandleThe handle of the parent key used to wrap the newly created key.This is usually obtainedfrom \fBTPM_LoadKey()\fP. A handle of 0x40000000 refers to the StorageRoot Key, which is in non-volatile storage, and need not be loaded..TP 10.B parauthThe parent key authorization data..TP 10.B keyauthThe key authorization data..TP 10.B migauthThe key migration authorization data..TP 10.B keyparmsA pointer to a keydata structure containing the parameters describingthe key to be created..TP 10.B newkeyA pointer to a keydata structure containing the resulting information for the newly created key..TP 10.B keyblobA pointer to an area which will receive a binary blob of the newly created key..TP 10.B bloblenA pointer to an integer which will receive the length of the new key blob..SH "ARGUMENT DESCRIPTIONS"There are two arguments that contain pointers to a \fBkeydata\fP structure,which is defined as follows....P.nftypedef struct keydata   {   unsigned char  version[4];   uint16_t       keyusage;   uint32_t       keyflags;   unsigned char  authdatausage;   pubkeydata     pub;   uint32_t       privkeylen;   unsigned char  encprivkey[1024];   } keydata;   typedef struct pubkeydata   {   uint32_t       algorithm;   uint16_t       encscheme;   uint16_t       sigscheme;   uint32_t       keybitlen;   uint32_t       numprimes;   uint32_t       expsize;   unsigned char  exponent[3];   uint32_t       keylength;   unsigned char  modulus[256];   uint32_t       pcrinfolen;   unsigned char  pcrinfo[256];   } pubkeydata;.fi.PIn the \fBkeyparms\fP argument, only those fields that specifyneeded key parameters are required to be filled out by the callingprogram.  This include the following fields....nh\fBkeyusage \fP, \fBkeyflags\fP, \fBalgorithm\fP, \fBencscheme\fP, \fBkeybitlen\fP,\fBnumprimes\fP, \fBexpsize\fP,\fBexponent\fP, \fBkeylength\fP, \fBpcrinfolen\fP, \fBpcrinfo\fP..hyFor a description of the values of these fields, see the TPM specificationdocument.The.nh\fBversion\fP, \fBprivkeylen\fP, \fBencprivkey\fP,and \fBmodulus\fP.hyvalues are ignoredin the \fBkeyparms\fP argument, and are filled in by the TPM and returnedin the \fBnewkey\fP argument..SH NOTES.PAll of the authorization arguments consist ofa 20 byte value which is usually calculated as the hash of a realpassword..SH "RETURN VALUE"0 if the operation is successful. non-zero otherwise.The non zero value can be converted to an error message via the function \fBTPM_GetErrMsg()\fP..SH "SEE ALSO".BR TPM_LoadKey(3) , TPM_GetErrMsg(3) ..SH AUTHORJeff Kravitz, IBM T.J. Watson Research Center

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?