/*++

+++TSP.idl

    Interface declarations for the TSS Service Provider 
    - COM interface for Windows based platforms
      
--*/
import "oaidl.idl";		// include ODL base types 
import "ocidl.idl";

//import the header files from TSS v1.2
import "tss_typedef.h";
import "tss_structs.h";

// forward declaration
interface ITCPAPolicy;
interface ITCPAKey;

/*
Missing:
TSS_RESULT Tspi_Context_Create
TSS_RESULT Tspi_Context_Close
TSS_RESULT Tspi_Context_FreeMemory
*/

    //ITCPAAttrib Interface
    [
        local,
        object,
        uuid(FBCD9C2E-72CB-47BB-99DD-2317551491DE),

        helpstring("ITCPAAttrib Interface"),
        pointer_default(unique)
    ]	
    interface ITCPAAttrib : IUnknown
    {
        [helpstring("method SetAttribUint32")]
        HRESULT SetAttribUint32([in] TSS_FLAG attribFlag, 
                                [in] TSS_FLAG subFlags,
                                [in] UINT32 ulAttrib);

        [helpstring("method GetAttribUint32")]
        HRESULT GetAttribUint32([in] TSS_FLAG attribFlag, 
                                [in] TSS_FLAG subFlags,
                                [out] UINT32* pulAttrib);

        [helpstring("method SetAttribData")]
        HRESULT SetAttribData([in] TSS_FLAG attribFlag, 
                              [in] TSS_FLAG subFlags, 
                              [in] UINT32 ulAttribDataSize, 
                              [in, ptr, size_is(ulAttribDataSize)] BYTE* pbAttribData);

        [helpstring("method GetAttribData")]
        HRESULT GetAttribData([in] TSS_FLAG attribFlag, 
                              [in] TSS_FLAG subFlags, 
                              [out] UINT32* pulAttribDataSize,
                              [out, size_is(, *pulAttribDataSize)] BYTE** ppbAttribData);
    }

    //ITCPAAuth Interface
    [
        local,
        object,
        uuid(FBCD9C2F-72CB-47BB-99DD-2317551491DE),

        helpstring("ITCPAAuth Interface"),
        pointer_default(unique)
    ]	
    interface ITCPAAuth : IUnknown
    {
        [helpstring("method GetPolicyObject")]
        HRESULT GetPolicyObject([in] TSS_FLAG PolicyType, 
                                [out] ITCPAPolicy** ppPolicyObject);

        [helpstring("method ChangeAuth")]
        HRESULT ChangeAuth([in] IUnknown* PpParentObject, 
                           [in] ITCPAPolicy* PpNewPolicy);

// HRESULT ChangeAuthAsym

    };

    [
        object,
        uuid(FBCD9C2D-72CB-47BB-99DD-2317551491DE),
        helpstring("ITCPAPcrs Interface"),
        pointer_default(unique)
    ]
    interface ITCPAPcrs : IUnknown
    {
        [helpstring("method SetPcrValue")]
        HRESULT SetPcrValue([in] UINT32 ulPCRIndex,
                            [in] UINT32 ulPcrValueLength,
                            [in, size_is(ulPcrValueLength)] BYTE* pbPcrValue);

        [helpstring("method GetPcrValue")]
        HRESULT GetPcrValue([in] UINT32 ulPCRIndex,
                            [out] UINT32* pulPcrValueLength,
                            [out, size_is(, *pulPcrValueLength)] BYTE** ppbPcrValue);

        [helpstring("method SelectPcrIndex")]
        HRESULT SelectPcrIndex([in] UINT32 ulPCRIndex);

    };

    //ITCPAKey Interface
    [
        object,
        uuid(FBCD9C27-72CB-47BB-99DD-2317551491DE),
    
        helpstring("ITCPAKey Interface"),
        pointer_default(unique)
    ]
    interface ITCPAKey : IUnknown
    {
        [helpstring("method LoadKey")] 
        HRESULT LoadKey([in] ITCPAKey* pUnwrappingKey);

        [helpstring("method CreateKey")]
        HRESULT CreateKey([in] ITCPAKey* pUnwrappingKey, 
                          [in] ITCPAPcrs* pPcrComosite);

        [helpstring("method WrapKey")] 
        HRESULT WrapKey([in] ITCPAKey* pWrappinKey, 
                        [in] ITCPAPcrs* pPcrComposite);
        
        [helpstring("method CertifyKey")] 
        HRESULT CertifyKey([in] ITCPAKey* pCertifyingKey,
                           [in, out, ptr] TSS_VALIDATION* pValidation);

        [helpstring("method GetPubKey")]
        HRESULT GetPubKey([out] UINT32* pulPubKeyLength,
                          [out, size_is(, *pulPubKeyLength)] BYTE** ppbPubKey);

        [helpstring("method UnLoadKey")] 
        HRESULT UnLoadKey();
    };

    // ITCPAMigration
    [
        local,
        object,
        uuid(FBCD9C30-72CB-47BB-99DD-2317551491DE),
    
        helpstring("ITCPAMigration Interface"),
        pointer_default(unique)
    ]
    interface ITCPAMigration : IUnknown
    {
        [helpstring("method CreateMigrationBlob")] 
        HRESULT CreateMigrationBlob([in] ITCPAKey *pParentKey, 
                                    [in] UINT32 ulMigTicketLength, 
                                    [in, size_is(ulMigTicketLength)] BYTE* rgbMigTicket, 
                                    [out] UINT32 *pulRandomLength, 
                                    [out, size_is(, *pulRandomLength)] BYTE **prgbRandom, 
                                    [out] UINT32 *pulMigrationBlobLength, 
                                    [out, size_is(, *pulMigrationBlobLength)] BYTE **prgbMigBlob);

        [helpstring("method ConvertMigrationBlob")] 
        HRESULT ConvertMigrationBlob([in] ITCPAKey *pParentKey, 
                                     [in] UINT32 ulRandomLength, 
                                     [in, size_is(ulRandomLength)] BYTE *rgbRandom, 
                                     [in] UINT32 ulMigrationBlobLength, 
                                     [in, size_is(ulMigrationBlobLength)] BYTE *rgbMigBlob);
    };

    //ITCPAEncData Interface
    [
        uuid(FBCD9C29-72CB-47BB-99DD-2317551491DE),
    
        helpstring("ITCPAEncData Interface"),
        pointer_default(unique)
    ]
    interface ITCPAEncData : IUnknown
    {
        [helpstring("method Seal")]
        HRESULT Seal([in] ITCPAKey* pEncKey,
                     [in] UINT32 ulDataLength, 
                     [in, size_is(ulDataLength)] BYTE* pbData, 
                     [in] ITCPAPcrs* pPcrComposite);

        [helpstring("method Unseal")] 
        HRESULT Unseal([in] ITCPAKey* pKey, 
                       [out] UINT32* pulUnsealedDataLength, 
                       [out, size_is(, *pulUnsealedDataLength)] BYTE** ppbData);

        [helpstring("method Bind")] 
        HRESULT Bind([in] ITCPAKey* pEncKey, 
                     [in] UINT32 ulDataLength, 
                     [in, size_is(ulDataLength)] BYTE* pbData);

        [helpstring("method Unbind")] 
        HRESULT Unbind([in] ITCPAKey* pKey, 
                       [out] UINT32* pulUnboundDataLength, 
                       [out, size_is(, *pulUnboundDataLength)] BYTE** ppbData);

    };

    //ITCPAHash Interface
    [
        local,
        object,
        uuid(FBCD9C2B-72CB-47BB-99DD-2317551491DE),
    
        helpstring("ITCPAHash Interface"),
        pointer_default(unique)
    ]
    interface ITCPAHash : IUnknown
    {
        [helpstring("method SetHashValue")] 
        HRESULT SetHashValue([in] UINT32 ulHashValueLength, 
                             [in, size_is(ulHashValueLength)] BYTE* pbHash);

        [helpstring("method GetHashValue")] 
        HRESULT GetHashValue([out] UINT32* pulHashValueLength, 
                             [out, size_is(, *pulHashValueLength)] BYTE** ppbHash);

        [helpstring("method UpdateHashValue")] 
        HRESULT UpdateHashValue([in] UINT32 ulDataLength, 
                                [in, size_is(ulDataLength)] BYTE* pbData);

        [helpstring("method Sign")] 
        HRESULT Sign([in] ITCPAKey* pKey, 
                     [out] UINT32* pulSignatureLength, 
                     [out, size_is(, *pulSignatureLength)] BYTE** ppbSignature);

        [helpstring("method VerifySignature")] 
        HRESULT VerifySignature([in] ITCPAKey* pKey, 
                                [in] UINT32 ulSignatureLength, 
                                [in, size_is(ulSignatureLength)] BYTE* pbSignature);

    };

    //ITCPAPolicy Interface
    [
        uuid(FBCD9C1E-72CB-47BB-99DD-2317551491DE),
    
        helpstring("ITCPAPolicy Interface"),
        pointer_default(unique)
    ]
    interface ITCPAPolicy : IUnknown
    { 
        [helpstring("method SetSecret")] 
        HRESULT SetSecret([in] TSS_FLAG SecretMode, 
                          [in] UINT32 ulSecretLength, 
                          [in, ptr, size_is(ulSecretLength)] BYTE* pbSecret);

        [helpstring("method FlushSecret")] 
        HRESULT FlushSecret();
        
        [helpstring("method AssignToObject")] 
        HRESULT AssignToObject([in] IUnknown* pUnkObject);

    };

    //ITCPAAdministration Interface
    [
        local,
        object,
        uuid(FBCD9C24-72CB-47BB-99DD-2317551491DE),

        helpstring("ITCPAAdministration Interface"),
        pointer_default(unique)
    ]	
    interface ITCPAAdministration : IUnknown
    {
        [helpstring("method SelfTestFull")]
        HRESULT SelfTestFull();

        [helpstring("method GetTestResult")]
        HRESULT GetTestResult([out] UINT32* pulTestResultLength,
                              [out, size_is(, *pulTestResultLength)] BYTE** ppbTestResult);

        [helpstring("method CertifySelfTest")]
        HRESULT CertifySelfTest([in] ITCPAKey* phKey,
                                [in, out, ptr] TSS_VALIDATION* pValidationData);

        [helpstring("method CreateEndorsementKey")] 
        HRESULT CreateEndorsementKey([in] ITCPAKey* pEndorsementKey,
                                     [in, out, ptr] TSS_VALIDATION* pValidation);

        [helpstring("method GetPubEndorsementKey")] 
        HRESULT GetPubEndorsementKey([in] BOOL fOwnerAuthorized,
                                     [in, out, ptr] TSS_VALIDATION* pValidation,
                                     [out] ITCPAKey** ppEndorsementKey);

        [helpstring("method TakeOwnerShip")] 
        HRESULT TakeOwnerShip([in] ITCPAKey* pKeySRK,
                              [in] ITCPAKey* pEndorsementKeyPubKey);

        [helpstring("method ClearOwner")] 
        HRESULT ClearOwner([in] BOOL fForcedClear);

        [helpstring("method SetStatus")] 
        HRESULT SetStatus([in] TSS_FLAG statusFlag, 
                          [in] BOOL fTpmState);

        [helpstring("method GetStatus")] 
        HRESULT GetStatus([in] TSS_FLAG statusFlag, 
                          [out] BOOL* pfTpmState);

        [helpstring("method AuthorizeMigrationTicket")] 
        HRESULT AuthorizeMigrationTicket([in] ITCPAKey* pMigrationKey,
                                         [in] UINT32 MigrationScheme,
                                         [out] UINT32* pulMigTicketLength,
                                         [out, size_is(, *pulMigTicketLength)] BYTE** ppbMigTicket);
    }

    //ITCPAIntegrity Interface
    [
        local,
        object,
        uuid(FBCD9C22-72CB-47BB-99DD-2317551491DE),
    
        helpstring("ITCPAIntegrity Interface"),
        pointer_default(unique)
    ]
    interface ITCPAIntegrity : IUnknown
    {
        [helpstring("method PcrExtend")] 
        HRESULT PcrExtend([in] UINT32 ulPcrIndex,
                          [in] UINT32 ulPcrDataLength,
                          [in, size_is(ulPcrDataLength)] BYTE* pbPcrData,
                          [in, ptr] TSS_PCR_EVENT* pEventInfo,
                          [out] UINT32* pulPcrValueLength,
                          [out, size_is(, *pulPcrValueLength)] BYTE** ppbPcrValue);

        [helpstring("method PcrRead")] 
        HRESULT PcrRead([in] UINT32 ulPcrIndex,
                        [out] UINT32* pulPcrValueLength,
                        [out, size_is(, *pulPcrValueLength)] BYTE** ppbPcrValue);

        [helpstring("method DirWrite")] 
        HRESULT DirWrite([in] UINT32 ulDirIndex, 
                         [in] UINT32 ulDirDataLength,
                         [in, size_is(ulDirDataLength)] BYTE* pbDirData);

        [helpstring("method DirRead")] 
        HRESULT DirRead([in] UINT32 ulDirIndex,
                        [out] UINT32* pulDirDataLength,
                        [out, size_is(, *pulDirDataLength)] BYTE** pbDirData);

        [helpstring("method Quote")] 
        HRESULT Quote([in] ITCPAKey* pIdentKey, 
                      [in] ITCPAPcrs* pPcrComposite, 
                      [in, out, ptr] TSS_VALIDATION* pValidation);
    };

    //ITCPAIdentityCreation Interface
    [
      object,
      uuid(FBCD9C23-72CB-47BB-99DD-2317551491DE),

      helpstring("ITCPAIdentityCreation Interface"),
      pointer_default(unique)
    ]   
    interface ITCPAIdentityCreation: IUnknown
    {
        [helpstring("method CollateIdentityRequest")]
        HRESULT CollateIdentityRequest([in] ITCPAKey* pKeySRK,
                                       [in] ITCPAKey* pCAPubKey,
                                       [in] UINT32 ulIdentityLabelLength, 
                                       [in, size_is(ulIdentityLabelLength)] BYTE* rgbIdentityLabelData,
                                       [in] ITCPAKey* pIdentityKey,
                                       [in] TSS_ALGORITHM_ID algID,
                                       [out] UINT32* pulTCPAIdentityReqLength,
                                       [out, size_is(, *pulTCPAIdentityReqLength)] BYTE** prgbTCPAIdentityReq);

        [helpstring("method ActivateIdentity")] 
        HRESULT ActivateIdentity([in] ITCPAKey* pIdentityKey, 
                                 [in] UINT32 ulAsymCAContentsBlobLength,
                                 [in, size_is(ulAsymCAContentsBlobLength)] BYTE* rgbAsymCAContentsBlob,
                                 [in] UINT32 ulSymCAAttestationBlobLength,
                                 [in, size_is(ulSymCAAttestationBlobLength)] BYTE* rgbSymCAAttestationBlob,
                                 [out] UINT32* pulCredentialLength,
                                 [out, size_is(, *pulCredentialLength)] BYTE** prgbCredential);
    
    };	// end of ITCPAIdentityCreation

    //ITCPAMaintenance Interface
    [
        local,
        object,
        uuid(FBCD9C25-72CB-47BB-99DD-2317551491DE),

        helpstring("ITCPAMaintenance Interface"),
        pointer_default(unique)
    ]	
    interface ITCPAMaintenance: IUnknown
    {

// HRESULT CreateMaintenanceArchive
// HRESULT KillMaintenanceFeature
// HRESULT LoadMaintenancePubKey
// HRESULT CheckMaintenancePubKey

    };

    //ITCPATpm Interface
    [
        uuid(FBCD9C21-72CB-47BB-99DD-2317551491DE),
    
        helpstring("ITCPATpm Interface"),
        pointer_default(unique)
    ]
    interface ITCPATpm : IUnknown
    {
        [helpstring("method GetRandom")] 
        HRESULT GetRandom([in] UINT32 ulRandomDataLength, 
                          [out, size_is(, ulRandomDataLength)] BYTE** ppbData);

        [helpstring("method StirRandom")] 
        HRESULT StirRandom([in] UINT32 ulEntropyDataLength, 
                           [in, size_is(ulEntropyDataLength)] BYTE* pbData);

        [helpstring("method GetCapability")] 
        HRESULT GetCapability([in] TSS_FLAG CapArea,
                              [in] UINT32 ulSubCapLength,
                              [in, ptr, size_is(ulSubCapLength)] BYTE* pbSubCap,
                              [out] UINT32* pulRespDataLength,
                              [out, size_is(, *pulRespDataLength)] BYTE** ppbRespData);
                               
        [helpstring("method GetCapabilitySigned")] 
        HRESULT GetCapabilitySigned([in] ITCPAKey* pKey,
                            [in] TSS_FLAG CapArea,
                            [in] UINT32 ulSubCapLength,
                            [in, ptr, size_is(ulSubCapLength)] BYTE* pbSubCap,
                            [in, out, ptr] TSS_VALIDATION *pValidation,
                            [out] UINT32* pulRespDataLength,
                            [out, size_is(, *pulRespDataLength)] BYTE** ppbRespData);

// HRESULT GetEvent
// HRESULT GetEvents
// HRESULT GetEventLog

    };

    //ITCPAPersistentStorage Interface
    [
        local,
        object,
        uuid(FBCD9C1C-72CB-47BB-99DD-2317551491DE),

        helpstring("ITCPAPersistentStorage Interface"),
        pointer_default(unique)
    ]	
    interface ITCPAPersistentStorage: IUnknown
    {
        [helpstring("method LoadKeyByUUID")]
        HRESULT LoadKeyByUUID([in] TSS_FLAG persistentStorageType,
                        [in] TSS_UUID uuidData,
                        [out] ITCPAKey** ppKey);

        [helpstring("method RegisterKey")] 
        HRESULT RegisterKey([in] ITCPAKey* pKey,
                      [in] TSS_FLAG persistentStorageType,
                      [in] TSS_UUID uuidKey, 
                      [in] TSS_FLAG persistentStorageTypeParent,
                      [in] TSS_UUID uuidParentKey); 

        [helpstring("method UnregisterKey")]
        HRESULT UnregisterKey([in] TSS_FLAG persistentStorageType,
                        [in] TSS_UUID uuidKey,
                        [out] ITCPAKey** ppKey);

        [helpstring("method DeleteKeyByUUID")] 
        HRESULT DeleteKeyByUUID([in] TSS_FLAG persistentStorageType,
                                [in] TSS_UUID uuidData);

        [helpstring("method GetKeyByUUID")] 
        HRESULT GetKeyByUUID([in] TSS_FLAG persistentStorageType,
                       [in] TSS_UUID uuidData,
                       [out] ITCPAKey** ppKey);

        [helpstring("method GetKeyByPublicInfo")] 
        HRESULT GetKeyByPublicInfo([in] TSS_FLAG persistentStorageType,
                             [in] TSS_ALGORITHM_ID  ulAlgId,
                             [in] UINT32 ulPublicInfoLength,
                             [in, size_is(ulPublicInfoLength)] BYTE* pbPublicInfo,
                             [out] ITCPAKey** ppKey);

        [helpstring("method GetRegisteredKeysByUUID")] 
        HRESULT GetRegisteredKeysByUUID([in] TSS_FLAG ulPersistentStorageType,
                                        [in] LPOLESTR wszKeyGuid,
                                        [out] UINT32* pulKeyHierarchySize,
                                        [out, size_is(, *pulKeyHierarchySize)] TSS_KM_KEYINFO** ppKeyHierarchy);
    }

    //ITCPAContext Interface
    [
        local,
        object,
        uuid(FBCD9C1B-72CB-47BB-99DD-2317551491DE),
    
        helpstring("ITCPAContext Interface"),
        pointer_default(unique)
    ]
    interface ITCPAContext : IUnknown
    {
        [helpstring("method Connect")] 
        HRESULT Connect([in, ptr] LPOLESTR wszRemoteMachine);

        [helpstring("method CreateObject")] 
        HRESULT CreateObject([in] UINT32 ulObjectType, 
                             [in] UINT32 ulInitFlags,
                             [out] IUnknown** ppUnkObject);

// HRESULT CloseObject


        [helpstring("method LoadKeyByBlob")]
        HRESULT LoadKeyByBlob([in] ITCPAKey* pUnwrappingKey,
                              [in] UINT32 ulBlobLength,
                              [in, size_is(ulBlobLength)] BYTE* pbBlobData,
                              [out] ITCPAKey** ppKey);

        [helpstring("method GetTPMObject")] 
        HRESULT GetTPMObject([out] ITCPATpm** ppTPMObject);

        [helpstring("method GetDefaultPolicy")] 
        HRESULT GetDefaultPolicy([out] ITCPAPolicy** ppPolicyObject);

        [helpstring("method GetCapability")] 
        HRESULT GetCapability([in] TSS_FLAG ulCapArea,
                              [in] UINT32 ulSubCapLength,
                              [in, ptr, size_is(ulSubCapLength)] BYTE* pbSubCap,
                              [out] UINT32* pulRespDataLength,
                              [out, size_is(, *pulRespDataLength)] BYTE** ppbRespData);
    };

    //ITCPANonVolatileStorage Interface
    [
        object,
        uuid(4730c51b-8998-43f6-993b-80befea1d404),
    
        helpstring("ITCPANonVolatileStorage Interface"),
        pointer_default(unique)
    ]
    interface ITCPANonVolatileStorage : IUnknown
    {
        [helpstring("method DefineSpace")]
        HRESULT DefineSpace([in] ITCPAPcrs* pPCRsRead,
                            [in] ITCPAPcrs* pPCRsWrite);

        [helpstring("method ReleaseSpace")] 
        HRESULT ReleaseSpace();

        [helpstring("method WriteValue")] 
        HRESULT WriteValue([in] UINT32 ulOffset,
                           [in] UINT32 ulDataLength,
                           [in, size_is(ulDataLength)] BYTE* rgbData);

        [helpstring("method ReadValue")] 
        HRESULT ReadValue([in] UINT32 ulOffset,
                          [in, out] UINT32* pulDataLength,
                          [out, size_is(, *pulDataLength)] BYTE** prgbData);
    };

    //ITCPATransport Interface
    [
        object,
        uuid(4730c51d-8998-43f6-993b-80befea1d404),
    
        helpstring("ITCPATransport Interface"),
        pointer_default(unique)
    ]
    interface ITCPATransport : IUnknown
    {
        [helpstring("method SetTransEncryptionKey")]
        HRESULT SetTransEncryptionKey([in] ITCPAKey* pKey);

        [helpstring("method CloseSignTransport")] 
        HRESULT CloseSignTransport([in] ITCPAKey* pSigningKey,
                                   [in, out, ptr] TSS_VALIDATION* pValidationData);
    };

[
    uuid(FBCD9C19-72CB-47BB-99DD-2317551491DE),
    version(1.0),
    helpstring("TSS Service Provider 1.0 Type Library")
]
library TSPLib
{
    importlib("stdole32.tlb");
    importlib("stdole2.tlb");

    interface ITCPAContext;
    //TCPAContext Class
    [
        uuid(FBCD9C1A-72CB-47BB-99DD-2317551491DE),
        helpstring("TCPAContext Class")
    ]
    coclass TCPAContext
    {
        [default] interface ITCPAContext;
        interface ITCPAAttrib;
        interface ITCPAPersistentStorage;
    };

    //TCPAContext2 Class extensions for TSS v1.2
    [
        uuid(4730C51E-8998-43F6-993B-80BEFEA1D404),
        helpstring("TCPAContext2 Class")
    ]
    coclass TCPAContext2
    {
        [default] interface ITCPAContext;
        interface ITCPAAttrib;
        interface ITCPAPersistentStorage;
        interface ITCPATransport;
    };

    // _ITCPACallback Interface for TCPAPolicy Class
    [
        uuid(FBCD9C1F-72CB-47BB-99DD-2317551491DE),
        helpstring("_ITCPACallback Interface"),
        pointer_default(unique)
    ]
    interface _ITCPACallback : IUnknown
    {
        [helpstring("method Tspicb_CallbackHMACAuth"), callback] 
        HRESULT Tspicb_CallbackHMACAuth([in] UINT32 PulAppData,
                                        [in] IUnknown *PpAuthorizedObject,
                                        [in] BOOL PfReturnOrVerify,
                                        [in] UINT32 PulPendingFunction,
                                        [in] BOOL PfContinueUse,
                                        [in] UINT32 PulSizeNonces,
                                        [in, size_is(PulSizeNonces)] BYTE* PrgbNonceEven,
                                        [in, size_is(PulSizeNonces)] BYTE* PrgbNonceOdd,
                                        [in, size_is(PulSizeNonces)] BYTE* PrgbNonceEvenOSAP,
                                        [in, size_is(PulSizeNonces)] BYTE* PrgbNonceOddOSAP,
                                        [in] UINT32 PulSizeDigestHmac,
                                        [in, size_is(PulSizeDigestHmac)] BYTE* PrgbParamDigest,
                                        [in, out, size_is(PulSizeDigestHmac)] BYTE* PrgbHmacData);

        [helpstring("method Tspicb_CallbackXorEnc"), callback] 
        HRESULT Tspicb_CallbackXorEnc([in] UINT32 PulAppData,
                                      [in] IUnknown *PpOSAPObject,
                                      [in] IUnknown *PpObject,
                                      [in] BOOL PfPurposeSecret,
                                      [in] UINT32 PulSizeNonces,
                                      [in, size_is(PulSizeNonces)] BYTE* PrgbNonceEven,
                                      [in, size_is(PulSizeNonces)] BYTE* PrgbNonceOdd,
                                      [in, size_is(PulSizeNonces)] BYTE* PrgbNonceEvenOSAP,
                                      [in, size_is(PulSizeNonces)] BYTE* PrgbNonceOddOSAP,
                                      [in] UINT32 PulSizeEncAuth,
                                      [out, size_is(PulSizeEncAuth)] BYTE* PrgbEncAuthUsage,
                                      [out, size_is(PulSizeEncAuth)] BYTE* PrgbEncAuthMigration);

        [helpstring("method Tspicb_CallbackTakeOwnership"), callback] 
        HRESULT Tspicb_CallbackTakeOwnership([in] UINT32 PulAppData,
                                             [in] IUnknown *PpObject,
                                             [in] IUnknown *PpObjectPubKey,
                                             [in] UINT32 PulSizeEncAuth,
                                             [out, size_is(PulSizeEncAuth)] BYTE* PrgbEncAuth );

        [helpstring("method Tspicb_CallbackChangeAuthAsym"), callback] 
        HRESULT Tspicb_CallbackChangeAuthAsym([in] UINT32 PulAppData,
                                              [in] IUnknown *PpObject,
                                              [in] IUnknown *PpObjectPubKey,
                                              [in] UINT32 PulSizeEncAuth,
                                              [in] UINT32 PulSizeAuthLink,
                                              [out, size_is(PulSizeEncAuth)] BYTE* PrgbEncAuth,
                                              [out, size_is(PulSizeAuthLink)] BYTE* PrgbAuthLink);
    };   // end of _ITCPACallback

    //TCPAPolicy Class
    [
        uuid(FBCD9C1D-72CB-47BB-99DD-2317551491DE),
        helpstring("TCPAPolicy Class"),
        noncreatable
    ]

    coclass TCPAPolicy
    {
        [default] interface ITCPAPolicy;
        interface ITCPAAttrib;
        [default, source] interface _ITCPACallback;
    };

    //TCPATpm Class
    [
        uuid(FBCD9C20-72CB-47BB-99DD-2317551491DE),
        helpstring("TCPATpm Class"),
        noncreatable
    ]
    coclass TCPATpm
    {
        [default] interface ITCPATpm;
        interface ITCPAAttrib;
        interface ITCPAAuth;
        interface ITCPAIntegrity;
        interface ITCPAAdministration;
        interface ITCPAIdentityCreation;
        interface ITCPAMaintenance;
    };

    //TCPAKey Class
    [
        uuid(FBCD9C26-72CB-47BB-99DD-2317551491DE),
        helpstring("TCPAKey Class"),
        noncreatable
    ]
    coclass TCPAKey
    {
        [default] interface ITCPAKey;
        interface ITCPAAttrib;
        interface ITCPAAuth;
        interface ITCPAMigration;
    };

    //TCPAEncData Class
    [
        uuid(FBCD9C28-72CB-47BB-99DD-2317551491DE),
        helpstring("TCPAEncData Class"),
        noncreatable
    ]
    coclass TCPAEncData
    {
        [default] interface ITCPAEncData;
        interface ITCPAAttrib;
        interface ITCPAAuth;
    };

    //TCPAHash Class
    [
        uuid(FBCD9C2A-72CB-47BB-99DD-2317551491DE),
        helpstring("TCPAHash Class"),
        noncreatable
    ]
    coclass TCPAHash
    {
        [default] interface ITCPAHash;
        interface ITCPAAttrib;
    };

    //TCPAPcrs Class
    [
        uuid(FBCD9C2C-72CB-47BB-99DD-2317551491DE),
        helpstring("TCPAPcrs Class"),
        noncreatable
    ]
    coclass TCPAPcrs
    {
        [default] interface ITCPAPcrs;
    };

    //TCPANonVolatileStorage Class
    [
        uuid(4730c51c-8998-43f6-993b-80befea1d404),
        helpstring("TCPANonVolatileStorage Class"),
        noncreatable
    ]
    coclass TCPANonVolatileStorage
    {
        [default] interface ITCPANonVolatileStorage;
        interface ITCPAAttrib;
        interface ITCPAAuth;
    };

};	// end of library TSPLib
