/// <summary> /// Get delegates without C_GetFunctionList function from the dynamically loaded shared PKCS#11 library /// </summary> /// <param name="libraryHandle">Handle to the PKCS#11 library</param> private void InitializeWithoutGetFunctionList(IntPtr libraryHandle) { CK_FUNCTION_LIST ckFunctionList = new CK_FUNCTION_LIST(); ckFunctionList.C_Initialize = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_Initialize"); ckFunctionList.C_Finalize = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_Finalize"); ckFunctionList.C_GetInfo = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_GetInfo"); ckFunctionList.C_GetFunctionList = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_GetFunctionList"); ckFunctionList.C_GetSlotList = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_GetSlotList"); ckFunctionList.C_GetSlotInfo = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_GetSlotInfo"); ckFunctionList.C_GetTokenInfo = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_GetTokenInfo"); ckFunctionList.C_GetMechanismList = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_GetMechanismList"); ckFunctionList.C_GetMechanismInfo = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_GetMechanismInfo"); ckFunctionList.C_InitToken = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_InitToken"); ckFunctionList.C_InitPIN = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_InitPIN"); ckFunctionList.C_SetPIN = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_SetPIN"); ckFunctionList.C_OpenSession = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_OpenSession"); ckFunctionList.C_CloseSession = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_CloseSession"); ckFunctionList.C_CloseAllSessions = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_CloseAllSessions"); ckFunctionList.C_GetSessionInfo = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_GetSessionInfo"); ckFunctionList.C_GetOperationState = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_GetOperationState"); ckFunctionList.C_SetOperationState = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_SetOperationState"); ckFunctionList.C_Login = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_Login"); ckFunctionList.C_Logout = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_Logout"); ckFunctionList.C_CreateObject = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_CreateObject"); ckFunctionList.C_CopyObject = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_CopyObject"); ckFunctionList.C_DestroyObject = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_DestroyObject"); ckFunctionList.C_GetObjectSize = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_GetObjectSize"); ckFunctionList.C_GetAttributeValue = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_GetAttributeValue"); ckFunctionList.C_SetAttributeValue = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_SetAttributeValue"); ckFunctionList.C_FindObjectsInit = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_FindObjectsInit"); ckFunctionList.C_FindObjects = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_FindObjects"); ckFunctionList.C_FindObjectsFinal = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_FindObjectsFinal"); ckFunctionList.C_EncryptInit = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_EncryptInit"); ckFunctionList.C_Encrypt = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_Encrypt"); ckFunctionList.C_EncryptUpdate = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_EncryptUpdate"); ckFunctionList.C_EncryptFinal = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_EncryptFinal"); ckFunctionList.C_DecryptInit = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_DecryptInit"); ckFunctionList.C_Decrypt = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_Decrypt"); ckFunctionList.C_DecryptUpdate = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_DecryptUpdate"); ckFunctionList.C_DecryptFinal = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_DecryptFinal"); ckFunctionList.C_DigestInit = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_DigestInit"); ckFunctionList.C_Digest = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_Digest"); ckFunctionList.C_DigestUpdate = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_DigestUpdate"); ckFunctionList.C_DigestKey = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_DigestKey"); ckFunctionList.C_DigestFinal = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_DigestFinal"); ckFunctionList.C_SignInit = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_SignInit"); ckFunctionList.C_Sign = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_Sign"); ckFunctionList.C_SignUpdate = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_SignUpdate"); ckFunctionList.C_SignFinal = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_SignFinal"); ckFunctionList.C_SignRecoverInit = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_SignRecoverInit"); ckFunctionList.C_SignRecover = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_SignRecover"); ckFunctionList.C_VerifyInit = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_VerifyInit"); ckFunctionList.C_Verify = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_Verify"); ckFunctionList.C_VerifyUpdate = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_VerifyUpdate"); ckFunctionList.C_VerifyFinal = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_VerifyFinal"); ckFunctionList.C_VerifyRecoverInit = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_VerifyRecoverInit"); ckFunctionList.C_VerifyRecover = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_VerifyRecover"); ckFunctionList.C_DigestEncryptUpdate = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_DigestEncryptUpdate"); ckFunctionList.C_DecryptDigestUpdate = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_DecryptDigestUpdate"); ckFunctionList.C_SignEncryptUpdate = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_SignEncryptUpdate"); ckFunctionList.C_DecryptVerifyUpdate = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_DecryptVerifyUpdate"); ckFunctionList.C_GenerateKey = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_GenerateKey"); ckFunctionList.C_GenerateKeyPair = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_GenerateKeyPair"); ckFunctionList.C_WrapKey = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_WrapKey"); ckFunctionList.C_UnwrapKey = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_UnwrapKey"); ckFunctionList.C_DeriveKey = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_DeriveKey"); ckFunctionList.C_SeedRandom = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_SeedRandom"); ckFunctionList.C_GenerateRandom = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_GenerateRandom"); ckFunctionList.C_GetFunctionStatus = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_GetFunctionStatus"); ckFunctionList.C_CancelFunction = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_CancelFunction"); ckFunctionList.C_WaitForSlotEvent = UnmanagedLibrary.GetFunctionPointer(libraryHandle, "C_WaitForSlotEvent"); Initialize(ckFunctionList); }
/// <summary> /// Get delegates from unmanaged function pointers /// </summary> /// <param name="ckFunctionList">Structure which contains cryptoki function pointers</param> private void Initialize(CK_FUNCTION_LIST ckFunctionList) { C_Initialize = UnmanagedLibrary.GetDelegateForFunctionPointer<C_InitializeDelegate>(ckFunctionList.C_Initialize); C_Finalize = UnmanagedLibrary.GetDelegateForFunctionPointer<C_FinalizeDelegate>(ckFunctionList.C_Finalize); C_GetInfo = UnmanagedLibrary.GetDelegateForFunctionPointer<C_GetInfoDelegate>(ckFunctionList.C_GetInfo); C_GetFunctionList = UnmanagedLibrary.GetDelegateForFunctionPointer<C_GetFunctionListDelegate>(ckFunctionList.C_GetFunctionList); C_GetSlotList = UnmanagedLibrary.GetDelegateForFunctionPointer<C_GetSlotListDelegate>(ckFunctionList.C_GetSlotList); C_GetSlotInfo = UnmanagedLibrary.GetDelegateForFunctionPointer<C_GetSlotInfoDelegate>(ckFunctionList.C_GetSlotInfo); C_GetTokenInfo = UnmanagedLibrary.GetDelegateForFunctionPointer<C_GetTokenInfoDelegate>(ckFunctionList.C_GetTokenInfo); C_GetMechanismList = UnmanagedLibrary.GetDelegateForFunctionPointer<C_GetMechanismListDelegate>(ckFunctionList.C_GetMechanismList); C_GetMechanismInfo = UnmanagedLibrary.GetDelegateForFunctionPointer<C_GetMechanismInfoDelegate>(ckFunctionList.C_GetMechanismInfo); C_InitToken = UnmanagedLibrary.GetDelegateForFunctionPointer<C_InitTokenDelegate>(ckFunctionList.C_InitToken); C_InitPIN = UnmanagedLibrary.GetDelegateForFunctionPointer<C_InitPINDelegate>(ckFunctionList.C_InitPIN); C_SetPIN = UnmanagedLibrary.GetDelegateForFunctionPointer<C_SetPINDelegate>(ckFunctionList.C_SetPIN); C_OpenSession = UnmanagedLibrary.GetDelegateForFunctionPointer<C_OpenSessionDelegate>(ckFunctionList.C_OpenSession); C_CloseSession = UnmanagedLibrary.GetDelegateForFunctionPointer<C_CloseSessionDelegate>(ckFunctionList.C_CloseSession); C_CloseAllSessions = UnmanagedLibrary.GetDelegateForFunctionPointer<C_CloseAllSessionsDelegate>(ckFunctionList.C_CloseAllSessions); C_GetSessionInfo = UnmanagedLibrary.GetDelegateForFunctionPointer<C_GetSessionInfoDelegate>(ckFunctionList.C_GetSessionInfo); C_GetOperationState = UnmanagedLibrary.GetDelegateForFunctionPointer<C_GetOperationStateDelegate>(ckFunctionList.C_GetOperationState); C_SetOperationState = UnmanagedLibrary.GetDelegateForFunctionPointer<C_SetOperationStateDelegate>(ckFunctionList.C_SetOperationState); C_Login = UnmanagedLibrary.GetDelegateForFunctionPointer<C_LoginDelegate>(ckFunctionList.C_Login); C_Logout = UnmanagedLibrary.GetDelegateForFunctionPointer<C_LogoutDelegate>(ckFunctionList.C_Logout); C_CreateObject = UnmanagedLibrary.GetDelegateForFunctionPointer<C_CreateObjectDelegate>(ckFunctionList.C_CreateObject); C_CopyObject = UnmanagedLibrary.GetDelegateForFunctionPointer<C_CopyObjectDelegate>(ckFunctionList.C_CopyObject); C_DestroyObject = UnmanagedLibrary.GetDelegateForFunctionPointer<C_DestroyObjectDelegate>(ckFunctionList.C_DestroyObject); C_GetObjectSize = UnmanagedLibrary.GetDelegateForFunctionPointer<C_GetObjectSizeDelegate>(ckFunctionList.C_GetObjectSize); C_GetAttributeValue = UnmanagedLibrary.GetDelegateForFunctionPointer<C_GetAttributeValueDelegate>(ckFunctionList.C_GetAttributeValue); C_SetAttributeValue = UnmanagedLibrary.GetDelegateForFunctionPointer<C_SetAttributeValueDelegate>(ckFunctionList.C_SetAttributeValue); C_FindObjectsInit = UnmanagedLibrary.GetDelegateForFunctionPointer<C_FindObjectsInitDelegate>(ckFunctionList.C_FindObjectsInit); C_FindObjects = UnmanagedLibrary.GetDelegateForFunctionPointer<C_FindObjectsDelegate>(ckFunctionList.C_FindObjects); C_FindObjectsFinal = UnmanagedLibrary.GetDelegateForFunctionPointer<C_FindObjectsFinalDelegate>(ckFunctionList.C_FindObjectsFinal); C_EncryptInit = UnmanagedLibrary.GetDelegateForFunctionPointer<C_EncryptInitDelegate>(ckFunctionList.C_EncryptInit); C_Encrypt = UnmanagedLibrary.GetDelegateForFunctionPointer<C_EncryptDelegate>(ckFunctionList.C_Encrypt); C_EncryptUpdate = UnmanagedLibrary.GetDelegateForFunctionPointer<C_EncryptUpdateDelegate>(ckFunctionList.C_EncryptUpdate); C_EncryptFinal = UnmanagedLibrary.GetDelegateForFunctionPointer<C_EncryptFinalDelegate>(ckFunctionList.C_EncryptFinal); C_DecryptInit = UnmanagedLibrary.GetDelegateForFunctionPointer<C_DecryptInitDelegate>(ckFunctionList.C_DecryptInit); C_Decrypt = UnmanagedLibrary.GetDelegateForFunctionPointer<C_DecryptDelegate>(ckFunctionList.C_Decrypt); C_DecryptUpdate = UnmanagedLibrary.GetDelegateForFunctionPointer<C_DecryptUpdateDelegate>(ckFunctionList.C_DecryptUpdate); C_DecryptFinal = UnmanagedLibrary.GetDelegateForFunctionPointer<C_DecryptFinalDelegate>(ckFunctionList.C_DecryptFinal); C_DigestInit = UnmanagedLibrary.GetDelegateForFunctionPointer<C_DigestInitDelegate>(ckFunctionList.C_DigestInit); C_Digest = UnmanagedLibrary.GetDelegateForFunctionPointer<C_DigestDelegate>(ckFunctionList.C_Digest); C_DigestUpdate = UnmanagedLibrary.GetDelegateForFunctionPointer<C_DigestUpdateDelegate>(ckFunctionList.C_DigestUpdate); C_DigestKey = UnmanagedLibrary.GetDelegateForFunctionPointer<C_DigestKeyDelegate>(ckFunctionList.C_DigestKey); C_DigestFinal = UnmanagedLibrary.GetDelegateForFunctionPointer<C_DigestFinalDelegate>(ckFunctionList.C_DigestFinal); C_SignInit = UnmanagedLibrary.GetDelegateForFunctionPointer<C_SignInitDelegate>(ckFunctionList.C_SignInit); C_Sign = UnmanagedLibrary.GetDelegateForFunctionPointer<C_SignDelegate>(ckFunctionList.C_Sign); C_SignUpdate = UnmanagedLibrary.GetDelegateForFunctionPointer<C_SignUpdateDelegate>(ckFunctionList.C_SignUpdate); C_SignFinal = UnmanagedLibrary.GetDelegateForFunctionPointer<C_SignFinalDelegate>(ckFunctionList.C_SignFinal); C_SignRecoverInit = UnmanagedLibrary.GetDelegateForFunctionPointer<C_SignRecoverInitDelegate>(ckFunctionList.C_SignRecoverInit); C_SignRecover = UnmanagedLibrary.GetDelegateForFunctionPointer<C_SignRecoverDelegate>(ckFunctionList.C_SignRecover); C_VerifyInit = UnmanagedLibrary.GetDelegateForFunctionPointer<C_VerifyInitDelegate>(ckFunctionList.C_VerifyInit); C_Verify = UnmanagedLibrary.GetDelegateForFunctionPointer<C_VerifyDelegate>(ckFunctionList.C_Verify); C_VerifyUpdate = UnmanagedLibrary.GetDelegateForFunctionPointer<C_VerifyUpdateDelegate>(ckFunctionList.C_VerifyUpdate); C_VerifyFinal = UnmanagedLibrary.GetDelegateForFunctionPointer<C_VerifyFinalDelegate>(ckFunctionList.C_VerifyFinal); C_VerifyRecoverInit = UnmanagedLibrary.GetDelegateForFunctionPointer<C_VerifyRecoverInitDelegate>(ckFunctionList.C_VerifyRecoverInit); C_VerifyRecover = UnmanagedLibrary.GetDelegateForFunctionPointer<C_VerifyRecoverDelegate>(ckFunctionList.C_VerifyRecover); C_DigestEncryptUpdate = UnmanagedLibrary.GetDelegateForFunctionPointer<C_DigestEncryptUpdateDelegate>(ckFunctionList.C_DigestEncryptUpdate); C_DecryptDigestUpdate = UnmanagedLibrary.GetDelegateForFunctionPointer<C_DecryptDigestUpdateDelegate>(ckFunctionList.C_DecryptDigestUpdate); C_SignEncryptUpdate = UnmanagedLibrary.GetDelegateForFunctionPointer<C_SignEncryptUpdateDelegate>(ckFunctionList.C_SignEncryptUpdate); C_DecryptVerifyUpdate = UnmanagedLibrary.GetDelegateForFunctionPointer<C_DecryptVerifyUpdateDelegate>(ckFunctionList.C_DecryptVerifyUpdate); C_GenerateKey = UnmanagedLibrary.GetDelegateForFunctionPointer<C_GenerateKeyDelegate>(ckFunctionList.C_GenerateKey); C_GenerateKeyPair = UnmanagedLibrary.GetDelegateForFunctionPointer<C_GenerateKeyPairDelegate>(ckFunctionList.C_GenerateKeyPair); C_WrapKey = UnmanagedLibrary.GetDelegateForFunctionPointer<C_WrapKeyDelegate>(ckFunctionList.C_WrapKey); C_UnwrapKey = UnmanagedLibrary.GetDelegateForFunctionPointer<C_UnwrapKeyDelegate>(ckFunctionList.C_UnwrapKey); C_DeriveKey = UnmanagedLibrary.GetDelegateForFunctionPointer<C_DeriveKeyDelegate>(ckFunctionList.C_DeriveKey); C_SeedRandom = UnmanagedLibrary.GetDelegateForFunctionPointer<C_SeedRandomDelegate>(ckFunctionList.C_SeedRandom); C_GenerateRandom = UnmanagedLibrary.GetDelegateForFunctionPointer<C_GenerateRandomDelegate>(ckFunctionList.C_GenerateRandom); C_GetFunctionStatus = UnmanagedLibrary.GetDelegateForFunctionPointer<C_GetFunctionStatusDelegate>(ckFunctionList.C_GetFunctionStatus); C_CancelFunction = UnmanagedLibrary.GetDelegateForFunctionPointer<C_CancelFunctionDelegate>(ckFunctionList.C_CancelFunction); C_WaitForSlotEvent = UnmanagedLibrary.GetDelegateForFunctionPointer<C_WaitForSlotEventDelegate>(ckFunctionList.C_WaitForSlotEvent); }
/// <summary> /// Get delegates from unmanaged function pointers /// </summary> /// <param name="ckFunctionList">Structure which contains cryptoki function pointers</param> private void Initialize(CK_FUNCTION_LIST ckFunctionList) { C_Initialize = (C_InitializeDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_Initialize, typeof(C_InitializeDelegate)); C_Finalize = (C_FinalizeDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_Finalize, typeof(C_FinalizeDelegate)); C_GetInfo = (C_GetInfoDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_GetInfo, typeof(C_GetInfoDelegate)); C_GetFunctionList = (C_GetFunctionListDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_GetFunctionList, typeof(C_GetFunctionListDelegate)); C_GetSlotList = (C_GetSlotListDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_GetSlotList, typeof(C_GetSlotListDelegate)); C_GetSlotInfo = (C_GetSlotInfoDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_GetSlotInfo, typeof(C_GetSlotInfoDelegate)); C_GetTokenInfo = (C_GetTokenInfoDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_GetTokenInfo, typeof(C_GetTokenInfoDelegate)); C_GetMechanismList = (C_GetMechanismListDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_GetMechanismList, typeof(C_GetMechanismListDelegate)); C_GetMechanismInfo = (C_GetMechanismInfoDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_GetMechanismInfo, typeof(C_GetMechanismInfoDelegate)); C_InitToken = (C_InitTokenDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_InitToken, typeof(C_InitTokenDelegate)); C_InitPIN = (C_InitPINDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_InitPIN, typeof(C_InitPINDelegate)); C_SetPIN = (C_SetPINDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_SetPIN, typeof(C_SetPINDelegate)); C_OpenSession = (C_OpenSessionDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_OpenSession, typeof(C_OpenSessionDelegate)); C_CloseSession = (C_CloseSessionDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_CloseSession, typeof(C_CloseSessionDelegate)); C_CloseAllSessions = (C_CloseAllSessionsDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_CloseAllSessions, typeof(C_CloseAllSessionsDelegate)); C_GetSessionInfo = (C_GetSessionInfoDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_GetSessionInfo, typeof(C_GetSessionInfoDelegate)); C_GetOperationState = (C_GetOperationStateDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_GetOperationState, typeof(C_GetOperationStateDelegate)); C_SetOperationState = (C_SetOperationStateDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_SetOperationState, typeof(C_SetOperationStateDelegate)); C_Login = (C_LoginDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_Login, typeof(C_LoginDelegate)); C_Logout = (C_LogoutDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_Logout, typeof(C_LogoutDelegate)); C_CreateObject = (C_CreateObjectDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_CreateObject, typeof(C_CreateObjectDelegate)); C_CopyObject = (C_CopyObjectDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_CopyObject, typeof(C_CopyObjectDelegate)); C_DestroyObject = (C_DestroyObjectDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_DestroyObject, typeof(C_DestroyObjectDelegate)); C_GetObjectSize = (C_GetObjectSizeDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_GetObjectSize, typeof(C_GetObjectSizeDelegate)); C_GetAttributeValue = (C_GetAttributeValueDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_GetAttributeValue, typeof(C_GetAttributeValueDelegate)); C_SetAttributeValue = (C_SetAttributeValueDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_SetAttributeValue, typeof(C_SetAttributeValueDelegate)); C_FindObjectsInit = (C_FindObjectsInitDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_FindObjectsInit, typeof(C_FindObjectsInitDelegate)); C_FindObjects = (C_FindObjectsDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_FindObjects, typeof(C_FindObjectsDelegate)); C_FindObjectsFinal = (C_FindObjectsFinalDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_FindObjectsFinal, typeof(C_FindObjectsFinalDelegate)); C_EncryptInit = (C_EncryptInitDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_EncryptInit, typeof(C_EncryptInitDelegate)); C_Encrypt = (C_EncryptDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_Encrypt, typeof(C_EncryptDelegate)); C_EncryptUpdate = (C_EncryptUpdateDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_EncryptUpdate, typeof(C_EncryptUpdateDelegate)); C_EncryptFinal = (C_EncryptFinalDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_EncryptFinal, typeof(C_EncryptFinalDelegate)); C_DecryptInit = (C_DecryptInitDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_DecryptInit, typeof(C_DecryptInitDelegate)); C_Decrypt = (C_DecryptDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_Decrypt, typeof(C_DecryptDelegate)); C_DecryptUpdate = (C_DecryptUpdateDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_DecryptUpdate, typeof(C_DecryptUpdateDelegate)); C_DecryptFinal = (C_DecryptFinalDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_DecryptFinal, typeof(C_DecryptFinalDelegate)); C_DigestInit = (C_DigestInitDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_DigestInit, typeof(C_DigestInitDelegate)); C_Digest = (C_DigestDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_Digest, typeof(C_DigestDelegate)); C_DigestUpdate = (C_DigestUpdateDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_DigestUpdate, typeof(C_DigestUpdateDelegate)); C_DigestKey = (C_DigestKeyDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_DigestKey, typeof(C_DigestKeyDelegate)); C_DigestFinal = (C_DigestFinalDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_DigestFinal, typeof(C_DigestFinalDelegate)); C_SignInit = (C_SignInitDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_SignInit, typeof(C_SignInitDelegate)); C_Sign = (C_SignDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_Sign, typeof(C_SignDelegate)); C_SignUpdate = (C_SignUpdateDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_SignUpdate, typeof(C_SignUpdateDelegate)); C_SignFinal = (C_SignFinalDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_SignFinal, typeof(C_SignFinalDelegate)); C_SignRecoverInit = (C_SignRecoverInitDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_SignRecoverInit, typeof(C_SignRecoverInitDelegate)); C_SignRecover = (C_SignRecoverDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_SignRecover, typeof(C_SignRecoverDelegate)); C_VerifyInit = (C_VerifyInitDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_VerifyInit, typeof(C_VerifyInitDelegate)); C_Verify = (C_VerifyDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_Verify, typeof(C_VerifyDelegate)); C_VerifyUpdate = (C_VerifyUpdateDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_VerifyUpdate, typeof(C_VerifyUpdateDelegate)); C_VerifyFinal = (C_VerifyFinalDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_VerifyFinal, typeof(C_VerifyFinalDelegate)); C_VerifyRecoverInit = (C_VerifyRecoverInitDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_VerifyRecoverInit, typeof(C_VerifyRecoverInitDelegate)); C_VerifyRecover = (C_VerifyRecoverDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_VerifyRecover, typeof(C_VerifyRecoverDelegate)); C_DigestEncryptUpdate = (C_DigestEncryptUpdateDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_DigestEncryptUpdate, typeof(C_DigestEncryptUpdateDelegate)); C_DecryptDigestUpdate = (C_DecryptDigestUpdateDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_DecryptDigestUpdate, typeof(C_DecryptDigestUpdateDelegate)); C_SignEncryptUpdate = (C_SignEncryptUpdateDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_SignEncryptUpdate, typeof(C_SignEncryptUpdateDelegate)); C_DecryptVerifyUpdate = (C_DecryptVerifyUpdateDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_DecryptVerifyUpdate, typeof(C_DecryptVerifyUpdateDelegate)); C_GenerateKey = (C_GenerateKeyDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_GenerateKey, typeof(C_GenerateKeyDelegate)); C_GenerateKeyPair = (C_GenerateKeyPairDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_GenerateKeyPair, typeof(C_GenerateKeyPairDelegate)); C_WrapKey = (C_WrapKeyDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_WrapKey, typeof(C_WrapKeyDelegate)); C_UnwrapKey = (C_UnwrapKeyDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_UnwrapKey, typeof(C_UnwrapKeyDelegate)); C_DeriveKey = (C_DeriveKeyDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_DeriveKey, typeof(C_DeriveKeyDelegate)); C_SeedRandom = (C_SeedRandomDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_SeedRandom, typeof(C_SeedRandomDelegate)); C_GenerateRandom = (C_GenerateRandomDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_GenerateRandom, typeof(C_GenerateRandomDelegate)); C_GetFunctionStatus = (C_GetFunctionStatusDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_GetFunctionStatus, typeof(C_GetFunctionStatusDelegate)); C_CancelFunction = (C_CancelFunctionDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_CancelFunction, typeof(C_CancelFunctionDelegate)); C_WaitForSlotEvent = (C_WaitForSlotEventDelegate)Marshal.GetDelegateForFunctionPointer(ckFunctionList.C_WaitForSlotEvent, typeof(C_WaitForSlotEventDelegate)); }