📄 tcs.h
字号:
#ifndef TCS_H
#define TCS_H
#include <tss/platform.h>
#include <tss/tss_structs.h>
#include <tss/tcs_typedef.h>
#include <tss/tcs_defines.h>
#include <tss/tcs_structs.h>
#include <tss/tcs_error.h>
#include <tss/tpm.h>
#if defined __cplusplus
extern "C" {
#endif
extern TSS_RESULT Tcsi_OpenContext
(
TCS_CONTEXT_HANDLE* hContext // out
);
extern TSS_RESULT Tcsi_CloseContext
(
TCS_CONTEXT_HANDLE hContext // in
);
extern TSS_RESULT Tcsi_FreeMemory
(
TCS_CONTEXT_HANDLE hContext, // in
BYTE* pMemory // in
);
extern TSS_RESULT Tcsi_GetCapability
(
TCS_CONTEXT_HANDLE hContext, // in
TPM_CAPABILITY_AREA capArea, // in
UINT32 subCapSize, // in
BYTE* subCap, // in
UINT32* respSize, // out
BYTE** resp // out
);
extern TSS_RESULT Tcsi_RegisterKey
(
TCS_CONTEXT_HANDLE hContext, // in
TSS_UUID WrappingKeyUUID, // in
TSS_UUID KeyUUID, // in
UINT32 cKeySize, // in
BYTE* rgbKey, // in
UINT32 cVendorDataSize, // in
BYTE* gbVendorData // in
);
extern TSS_RESULT Tcsip_UnregisterKey
(
TCS_CONTEXT_HANDLE hContext, // in
TSS_UUID KeyUUID // in
);
extern TSS_RESULT Tcsip_KeyControlOwner
(
TCS_CONTEXT_HANDLE hContext, // in
TCS_KEY_HANDLE hKey, // in
UINT32 ulPubKeyLength, // in
BYTE* prgbPubKey, // in
UINT32 attribName, // in
TSS_BOOL attribValue, // in
TPM_AUTH* pOwnerAuth, // in, out
TSS_UUID* pUuidData // out
);
extern TSS_RESULT Tcsi_EnumRegisteredKeys
(
TCS_CONTEXT_HANDLE hContext, // in
TSS_UUID* pKeyUUID, // in
UINT32* pcKeyHierarchySize, // out
TSS_KM_KEYINFO** ppKeyHierarchy // out
);
extern TSS_RESULT Tcsi_GetRegisteredKey
(
TCS_CONTEXT_HANDLE hContext, // in
TSS_UUID KeyUUID, // in
TSS_KM_KEYINFO** ppKeyInfo // out
);
extern TSS_RESULT Tcsi_GetRegisteredKeyBlob
(
TCS_CONTEXT_HANDLE hContext, // in
TSS_UUID KeyUUID, // in
UINT32* pcKeySize, // out
BYTE** prgbKey // out
);
extern TSS_RESULT Tcsip_GetRegisteredKeyByPublicInfo
(
TCS_CONTEXT_HANDLE hContext, // in
TSS_ALGORITHM_ID algID, // in
UINT32 ulPublicInfoLength, // in
BYTE* rgbPublicInfo, // in
UINT32* keySize, // out
BYTE** keyBlob // out
);
extern TSS_RESULT Tcsip_LoadKeyByBlob
(
TCS_CONTEXT_HANDLE hContext, // in
TCS_KEY_HANDLE hUnwrappingKey, // in
UINT32 cWrappedKeyBlobSize, // in
BYTE* rgbWrappedKeyBlob, // in
TPM_AUTH* pAuth, // in, out
TCS_KEY_HANDLE* phKeyTCSI, // out
TCS_KEY_HANDLE* phKeyHMAC // out
);
extern TSS_RESULT Tcsip_LoadKeyByUUID
(
TCS_CONTEXT_HANDLE hContext, // in
TSS_UUID KeyUUID, // in
TCS_LOADKEY_INFO* pLoadKeyInfo, // in, out
TCS_KEY_HANDLE* phKeyTCSI // out
);
extern TSS_RESULT Tcsip_EvictKey
(
TCS_CONTEXT_HANDLE hContext, // in
TCS_KEY_HANDLE hKey // in
);
extern TSS_RESULT Tcsip_CreateWrapKey
(
TCS_CONTEXT_HANDLE hContext, // in
TCS_KEY_HANDLE hWrappingKey, // in
TPM_ENCAUTH KeyUsageAuth, // in
TPM_ENCAUTH KeyMigrationAuth, // in
UINT32 keyInfoSize, // in
BYTE* keyInfo, // in
TPM_AUTH* pAuth, // in, out
UINT32* keyDataSize, // out
BYTE** keyData // out
);
extern TSS_RESULT Tcsip_GetPubKey
(
TCS_CONTEXT_HANDLE hContext, // in
TCS_KEY_HANDLE hKey, // in
TPM_AUTH* pAuth, // in, out
UINT32* pcPubKeySize, // out
BYTE** prgbPubKey // out
);
extern TSS_RESULT Tcsip_MakeIdentity
(
TCS_CONTEXT_HANDLE hContext, // in
TPM_ENCAUTH identityAuth, // in
TPM_CHOSENID_HASH IDLabel_PrivCAHash, // in
UINT32 idIdentityKeyInfoSize, // in
BYTE* idIdentityKeyInfo, // in
TPM_AUTH* pSrkAuth, // in, out
TPM_AUTH* pOwnerAuth, // in, out
UINT32* idIdentityKeySize, // out
BYTE** idIdentityKey, // out
UINT32* pcIdentityBindingSize, // out
BYTE** prgbIdentityBinding, // out
UINT32* pcEndorsementCredentialSize, // out
BYTE** prgbEndorsementCredential, // out
UINT32* pcPlatformCredentialSize, // out
BYTE** prgbPlatformCredential, // out
UINT32* pcConformanceCredentialSize, // out
BYTE** prgbConformanceCredential // out
);
extern TSS_RESULT Tcsip_MakeIdentity2
(
TCS_CONTEXT_HANDLE hContext, // in
TPM_ENCAUTH identityAuth, // in
TPM_CHOSENID_HASH IDLabel_PrivCAHash, // in
UINT32 idIdentityKeyInfoSize, // in
BYTE* idIdentityKeyInfo, // in
TPM_AUTH* pSrkAuth, // in, out
TPM_AUTH* pOwnerAuth, // in, out
UINT32* idIdentityKeySize, // out
BYTE** idIdentityKey, // out
UINT32* pcIdentityBindingSize, // out
BYTE** prgbIdentityBinding // out
);
extern TSS_RESULT Tcsi_LogPcrEvent
(
TCS_CONTEXT_HANDLE hContext, // in
TSS_PCR_EVENT Event, // in
UINT32* pNumber // out
);
extern TSS_RESULT Tcsi_GetPcrEvent
(
TCS_CONTEXT_HANDLE hContext, // in
UINT32 PcrIndex, // in
UINT32* pNumber, // in, out
TSS_PCR_EVENT** ppEvent // out
);
extern TSS_RESULT Tcsi_GetPcrEventsByPcr
(
TCS_CONTEXT_HANDLE hContext, // in
UINT32 PcrIndex, // in
UINT32 FirstEvent, // in
UINT32* pEventCount, // in, out
TSS_PCR_EVENT** ppEvents // out
);
extern TSS_RESULT Tcsi_GetPcrEventLog
(
TCS_CONTEXT_HANDLE hContext, // in
UINT32* pEventCount, // out
TSS_PCR_EVENT** ppEvents // out
);
extern TSS_RESULT Tcsip_SetOwnerInstall
(
TCS_CONTEXT_HANDLE hContext, // in
TSS_BOOL state // in
);
extern TSS_RESULT Tcsip_TakeOwnership
(
TCS_CONTEXT_HANDLE hContext, // in
UINT16 protocolID, // in
UINT32 encOwnerAuthSize, // in
BYTE* encOwnerAuth, // in
UINT32 encSrkAuthSize, // in
BYTE* encSrkAuth, // in
UINT32 srkKeyInfoSize, // in
BYTE* srkKeyInfo, // in
TPM_AUTH* ownerAuth, // in, out
UINT32* srkKeyDataSize, // out
BYTE** srkKeyData // out
);
extern TSS_RESULT Tcsip_SetOperatorAuth
(
TCS_CONTEXT_HANDLE hContext, // in
TPM_SECRET operatorAuth // in
);
extern TSS_RESULT Tcsip_OIAP
(
TCS_CONTEXT_HANDLE hContext, // in
TCS_AUTHHANDLE* authHandle, // out
TPM_NONCE* nonce0 // out
);
extern TSS_RESULT Tcsip_OSAP
(
TCS_CONTEXT_HANDLE hContext, // in
TPM_ENTITY_TYPE entityType, // in
UINT32 entityValue, // in
TPM_NONCE nonceOddOSAP, // in
TCS_AUTHHANDLE* authHandle, // out
TPM_NONCE* nonceEven, // out
TPM_NONCE* nonceEvenOSAP // out
);
extern TSS_RESULT Tcsip_ChangeAuth
(
TCS_CONTEXT_HANDLE hContext, // in
TCS_KEY_HANDLE parentHandle, // in
TPM_PROTOCOL_ID protocolID, // in
TPM_ENCAUTH newAuth, // in
TPM_ENTITY_TYPE entityType, // in
UINT32 encDataSize, // in
BYTE* encData, // in
TPM_AUTH* ownerAuth, // in, out
TPM_AUTH* entityAuth, // in, out
UINT32* outDataSize, // out
BYTE** outData // out
);
extern TSS_RESULT Tcsip_ChangeAuthOwner
(
TCS_CONTEXT_HANDLE hContext, // in
TPM_PROTOCOL_ID protocolID, // in
TPM_ENCAUTH newAuth, // in
TPM_ENTITY_TYPE entityType, // in
TPM_AUTH* ownerAuth // in, out
);
extern TSS_RESULT Tcsip_ChangeAuthAsymStart
(
TCS_CONTEXT_HANDLE hContext, // in
TCS_KEY_HANDLE idHandle, // in
TPM_NONCE antiReplay, // in
UINT32 TempKeyInfoSize, // in
BYTE* TempKeyInfoData, // in
TPM_AUTH* pAuth, // in, out
UINT32* TempKeySize, // out
BYTE** TempKeyData, // out
UINT32* CertifyInfoSize, // out
BYTE** CertifyInfo, // out
UINT32* sigSize, // out
BYTE** sig, // out
TCS_KEY_HANDLE* ephHandle // out
);
extern TSS_RESULT Tcsip_ChangeAuthAsymFinish
(
TCS_CONTEXT_HANDLE hContext, // in
TCS_KEY_HANDLE parentHandle, // in
TCS_KEY_HANDLE ephHandle, // in
TPM_ENTITY_TYPE entityType, // in
TPM_HMAC newAuthLink, // in
UINT32 newAuthSize, // in
BYTE* encNewAuth, // in
UINT32 encDataSizeIn, // in
BYTE* encDataIn, // in
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -