⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tspi.h

📁 TCG软件栈 linux系统上使用 为可信应用软件提供和 TPM通信的 接口 其网站上有很多关于使用此软件的测试用例
💻 H
📖 第 1 页 / 共 3 页
字号:
#if !defined(_TSPI_H_)
#define _TSPI_H_

#include <tss/tss_defines.h>
#include <tss/tss_typedef.h>
#include <tss/tss_structs.h>
#include <tss/tss_error.h>
#include <tss/tss_error_basics.h>

#if !defined( TSPICALL )
  #if !defined(WIN32) || defined (TSP_STATIC)
    // Linux, or a Win32 static library
    #define TSPICALL extern TSS_RESULT
  #elif defined (TSPDLL_EXPORTS)
    // Win32 DLL build
    #define TSPICALL extern __declspec(dllexport) TSS_RESULT
  #else
    // Win32 DLL import
    #define TSPICALL extern __declspec(dllimport) TSS_RESULT
  #endif
#endif /* TSPICALL */

#if defined ( __cplusplus )
extern "C" {
#endif /* __cplusplus */


// Class-independent ASN.1 conversion functions
TSPICALL Tspi_EncodeDER_TssBlob
(
    UINT32              rawBlobSize,                   // in
    BYTE*               rawBlob,                       // in
    UINT32              blobType,                      // in
    UINT32*             derBlobSize,                   // in, out
    BYTE*               derBlob                        // out
);

TSPICALL Tspi_DecodeBER_TssBlob
(
    UINT32              berBlobSize,                   // in
    BYTE*               berBlob,                       // in
    UINT32*             blobType,                      // out
    UINT32*             rawBlobSize,                   // in, out
    BYTE*               rawBlob                        // out
);



// Common Methods
TSPICALL Tspi_SetAttribUint32
(
    TSS_HOBJECT         hObject,                       // in
    TSS_FLAG            attribFlag,                    // in
    TSS_FLAG            subFlag,                       // in
    UINT32              ulAttrib                       // in
);

TSPICALL Tspi_GetAttribUint32
(
    TSS_HOBJECT         hObject,                       // in
    TSS_FLAG            attribFlag,                    // in
    TSS_FLAG            subFlag,                       // in
    UINT32*             pulAttrib                      // out
);

TSPICALL Tspi_SetAttribData
(
    TSS_HOBJECT         hObject,                       // in
    TSS_FLAG            attribFlag,                    // in
    TSS_FLAG            subFlag,                       // in
    UINT32              ulAttribDataSize,              // in
    BYTE*               rgbAttribData                  // in
);

TSPICALL Tspi_GetAttribData
(
    TSS_HOBJECT         hObject,                       // in
    TSS_FLAG            attribFlag,                    // in
    TSS_FLAG            subFlag,                       // in
    UINT32*             pulAttribDataSize,             // out
    BYTE**              prgbAttribData                 // out
);

TSPICALL Tspi_ChangeAuth
(
    TSS_HOBJECT         hObjectToChange,               // in
    TSS_HOBJECT         hParentObject,                 // in
    TSS_HPOLICY         hNewPolicy                     // in
);

TSPICALL Tspi_ChangeAuthAsym
(
    TSS_HOBJECT         hObjectToChange,               // in
    TSS_HOBJECT         hParentObject,                 // in
    TSS_HKEY            hIdentKey,                     // in
    TSS_HPOLICY         hNewPolicy                     // in
);

TSPICALL Tspi_GetPolicyObject
(
    TSS_HOBJECT         hObject,                       // in
    TSS_FLAG            policyType,                    // in
    TSS_HPOLICY*        phPolicy                       // out
);



// Tspi_Context Class Definitions
TSPICALL Tspi_Context_Create
(
    TSS_HCONTEXT*       phContext                      // out
);

TSPICALL Tspi_Context_Close
(
    TSS_HCONTEXT        hContext                       // in
);

TSPICALL Tspi_Context_Connect
(
    TSS_HCONTEXT        hContext,                      // in
    TSS_UNICODE*        wszDestination                 // in
);

TSPICALL Tspi_Context_FreeMemory
(
    TSS_HCONTEXT        hContext,                      // in
    BYTE*               rgbMemory                      // in
);

TSPICALL Tspi_Context_GetDefaultPolicy
(
    TSS_HCONTEXT        hContext,                      // in
    TSS_HPOLICY*        phPolicy                       // out
);

TSPICALL Tspi_Context_CreateObject
(
    TSS_HCONTEXT        hContext,                      // in
    TSS_FLAG            objectType,                    // in
    TSS_FLAG            initFlags,                     // in
    TSS_HOBJECT*        phObject                       // out
);

TSPICALL Tspi_Context_CloseObject
(
    TSS_HCONTEXT        hContext,                      // in
    TSS_HOBJECT         hObject                        // in
);

TSPICALL Tspi_Context_GetCapability
(
    TSS_HCONTEXT        hContext,                      // in
    TSS_FLAG            capArea,                       // in
    UINT32              ulSubCapLength,                // in
    BYTE*               rgbSubCap,                     // in
    UINT32*             pulRespDataLength,             // out
    BYTE**              prgbRespData                   // out
);

TSPICALL Tspi_Context_GetTpmObject
(
    TSS_HCONTEXT        hContext,                      // in
    TSS_HTPM*           phTPM                          // out
);

TSPICALL Tspi_Context_SetTransEncryptionKey
(
    TSS_HCONTEXT        hContext,                      // in
    TSS_HKEY            hKey                           // in
);

TSPICALL Tspi_Context_CloseSignTransport
(
    TSS_HCONTEXT        hContext,                      // in
    TSS_HKEY            hSigningKey,                   // in
    TSS_VALIDATION*     pValidationData                // in, out
);

TSPICALL Tspi_Context_LoadKeyByBlob
(
    TSS_HCONTEXT        hContext,                      // in
    TSS_HKEY            hUnwrappingKey,                // in
    UINT32              ulBlobLength,                  // in
    BYTE*               rgbBlobData,                   // in
    TSS_HKEY*           phKey                          // out
);

TSPICALL Tspi_Context_LoadKeyByUUID
(
    TSS_HCONTEXT        hContext,                      // in
    TSS_FLAG            persistentStorageType,         // in
    TSS_UUID            uuidData,                      // in
    TSS_HKEY*           phKey                          // out
);

TSPICALL Tspi_Context_RegisterKey
(
    TSS_HCONTEXT        hContext,                      // in
    TSS_HKEY            hKey,                          // in
    TSS_FLAG            persistentStorageType,         // in
    TSS_UUID            uuidKey,                       // in
    TSS_FLAG            persistentStorageTypeParent,   // in
    TSS_UUID            uuidParentKey                  // in
);

TSPICALL Tspi_Context_UnregisterKey
(
    TSS_HCONTEXT        hContext,                      // in
    TSS_FLAG            persistentStorageType,         // in
    TSS_UUID            uuidKey,                       // in
    TSS_HKEY*           phkey                          // out
);

TSPICALL Tspi_Context_GetKeyByUUID
(
    TSS_HCONTEXT        hContext,                      // in
    TSS_FLAG            persistentStorageType,         // in
    TSS_UUID            uuidData,                      // in
    TSS_HKEY*           phKey                          // out
);

TSPICALL Tspi_Context_GetKeyByPublicInfo
(
    TSS_HCONTEXT        hContext,                      // in
    TSS_FLAG            persistentStorageType,         // in
    TSS_ALGORITHM_ID    algID,                         // in
    UINT32              ulPublicInfoLength,            // in
    BYTE*               rgbPublicInfo,                 // in
    TSS_HKEY*           phKey                          // out
);

TSPICALL Tspi_Context_GetRegisteredKeysByUUID
(
    TSS_HCONTEXT        hContext,                      // in
    TSS_FLAG            persistentStorageType,         // in
    TSS_UUID*           pUuidData,                     // in
    UINT32*             pulKeyHierarchySize,           // out
    TSS_KM_KEYINFO**    ppKeyHierarchy                 // out
);

TSPICALL Tspi_Context_GetRegisteredKeysByUUID2
(
    TSS_HCONTEXT        hContext,                      // in
    TSS_FLAG            persistentStorageType,         // in
    TSS_UUID*           pUuidData,                     // in
    UINT32*             pulKeyHierarchySize,           // out
    TSS_KM_KEYINFO2**   ppKeyHierarchy                 // out
);


// Policy class definitions
TSPICALL Tspi_Policy_SetSecret
(
    TSS_HPOLICY         hPolicy,                       // in
    TSS_FLAG            secretMode,                    // in
    UINT32              ulSecretLength,                // in
    BYTE*               rgbSecret                      // in
);

TSPICALL Tspi_Policy_FlushSecret
(
    TSS_HPOLICY         hPolicy                        // in
);

TSPICALL Tspi_Policy_AssignToObject
(
    TSS_HPOLICY         hPolicy,                       // in
    TSS_HOBJECT         hObject                        // in
);



// TPM Class Definitions
TSPICALL Tspi_TPM_KeyControlOwner
(
    TSS_HTPM            hTPM,                          // in
    TSS_HKEY            hKey,                          // in
    UINT32              attribName,                    // in
    TSS_BOOL            attribValue,                   // in
    TSS_UUID*           pUuidData                      // out
);

TSPICALL Tspi_TPM_CreateEndorsementKey
(
    TSS_HTPM            hTPM,                          // in
    TSS_HKEY            hKey,                          // in
    TSS_VALIDATION*     pValidationData                // in, out
);

TSPICALL Tspi_TPM_CreateRevocableEndorsementKey
(
    TSS_HTPM            hTPM,                          // in
    TSS_HKEY            hKey,                          // in
    TSS_VALIDATION*     pValidationData,               // in, out
    UINT32*             pulEkResetDataLength,          // in, out
    BYTE**              rgbEkResetData                 // in, out
);

TSPICALL Tspi_TPM_RevokeEndorsementKey
(
    TSS_HTPM            hTPM,                          // in
    UINT32              ulEkResetDataLength,           // in
    BYTE*               rgbEkResetData                 // in
);

TSPICALL Tspi_TPM_GetPubEndorsementKey
(
    TSS_HTPM            hTPM,                          // in
    TSS_BOOL            fOwnerAuthorized,              // in
    TSS_VALIDATION*     pValidationData,               // in, out
    TSS_HKEY*           phEndorsementPubKey            // out
);

TSPICALL Tspi_TPM_OwnerGetSRKPubKey
(
    TSS_HTPM            hTPM,                          // in
    UINT32*             pulPubKeyLength,               // out
    BYTE**              prgbPubKey                     // out
);

TSPICALL Tspi_TPM_TakeOwnership
(
    TSS_HTPM            hTPM,                          // in
    TSS_HKEY            hKeySRK,                       // in
    TSS_HKEY            hEndorsementPubKey             // in
);

TSPICALL Tspi_TPM_ClearOwner
(
    TSS_HTPM            hTPM,                          // in
    TSS_BOOL            fForcedClear                   // in
);

TSPICALL Tspi_TPM_CollateIdentityRequest
(
    TSS_HTPM            hTPM,                          // in
    TSS_HKEY            hKeySRK,                       // in
    TSS_HKEY            hCAPubKey,                     // in
    UINT32              ulIdentityLabelLength,         // in
    BYTE*               rgbIdentityLabelData,          // in
    TSS_HKEY            hIdentityKey,                  // in
    TSS_ALGORITHM_ID    algID,                         // in
    UINT32*             pulTCPAIdentityReqLength,      // out
    BYTE**              prgbTCPAIdentityReq            // out
);

TSPICALL Tspi_TPM_ActivateIdentity
(
    TSS_HTPM            hTPM,                          // in
    TSS_HKEY            hIdentKey,                     // in
    UINT32              ulAsymCAContentsBlobLength,    // in
    BYTE*               rgbAsymCAContentsBlob,         // in
    UINT32              ulSymCAAttestationBlobLength,  // in
    BYTE*               rgbSymCAAttestationBlob,       // in
    UINT32*             pulCredentialLength,           // out
    BYTE**              prgbCredential                 // out
);

TSPICALL Tspi_TPM_CreateMaintenanceArchive
(
    TSS_HTPM            hTPM,                          // in
    TSS_BOOL            fGenerateRndNumber,            // in
    UINT32*             pulRndNumberLength,            // out
    BYTE**              prgbRndNumber,                 // out
    UINT32*             pulArchiveDataLength,          // out
    BYTE**              prgbArchiveData                // out
);

TSPICALL Tspi_TPM_KillMaintenanceFeature
(
    TSS_HTPM            hTPM                           // in
);

TSPICALL Tspi_TPM_LoadMaintenancePubKey
(
    TSS_HTPM            hTPM,                          // in
    TSS_HKEY            hMaintenanceKey,               // in
    TSS_VALIDATION*     pValidationData                // in, out
);

TSPICALL Tspi_TPM_CheckMaintenancePubKey
(
    TSS_HTPM            hTPM,                          // in
    TSS_HKEY            hMaintenanceKey,               // in
    TSS_VALIDATION*     pValidationData                // in, out
);

TSPICALL Tspi_TPM_SetOperatorAuth
(
    TSS_HTPM            hTPM,                          // in
    TSS_HPOLICY         hOperatorPolicy                // in
);

TSPICALL Tspi_TPM_SetStatus
(
    TSS_HTPM            hTPM,                          // in
    TSS_FLAG            statusFlag,                    // in
    TSS_BOOL            fTpmState                      // in
);

⌨️ 快捷键说明

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