📄 tpm_sign.3
字号:
.\" Copyright 2004 IBM (Jeff Kravitz).\".\" Written Jan 29 2004, Jeff Kravitz.\".TH "TPM_Sign" 3 2004-04-15 "IBM" "TPM Library".SH NAMETPM_Sign.SH SYNOPSIS.nf.B #include <tpmfunc.h>.sp.BR "uint32_t TPM_Sign" "(uint32_t keyhandle," unsigned char *keyauth, unsigned char *data,int datalen, unsigned char *sigblob, unsigned int *siglen).fi.SH DESCRIPTIONThe \fBTPM_Sign()\fP function performs a cryptographic signature operationusing a loaded key..SH ARGUMENTSThe arguments include....TP 10.B keyhandleThe handle of the key to be used for signing.This is usually obtained from \fBTPM_LoadKey()\fP..TP 10.B keyauthA pointer to the key authorization data(a 20 byte value which is usually calculated as the hash of a password).If NULL, it will be assumed that no password is required..TP 10.B dataA pointer to the data to be signed (usually a hash of the actual data)..TP 10.B datalenThe length of the data being signed..TP 10.B sigblobA pointer to an area to receive the signature..TP 10.B siglenA pointer to an integer to receive the size of the signature..SH NOTES.PThe area receiving the signature must be the size of the maximum signature,as no buffer overflow checking is performed. For current TPM usage, signaturesof 256 bytes are the maximum..PThe data being signed must be no longer than the size of thekey being used to sign it. Normal public key signatures do not actually sign the cleartextdata, but sign a cryptographic hash of the cleartext. The hash may be calculatedusing the \fBTSS_sha1()\fP function, if the data is one contiguous area of memory. Ifthe data cannot fit in memory, or must be hashed in non-contiguous pieces, thenthe OpenSSL hash functions should be used..PThe key handle must reference a signing key, not an encryption key..PIf the key being used for the signing operation was created with the option that specifiesthat no password is required for use, then the pointer to the authorization datamust be NULL..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) , TSS_sha1(3) , TPM_GetErrMsg(3) ..SH AUTHORJeff Kravitz, IBM T.J. Watson Research Center
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -