Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="slotID"></param>
        /// <returns></returns>
        public CK_SLOT_INFO GetSlotInfo(uint slotID)
        {
            C_GetSlotInfo proc = (C_GetSlotInfo)DelegateUtil.GetDelegate(this.hLib, typeof(C_GetSlotInfo));

            CK_SLOT_INFO slotInfo = new CK_SLOT_INFO();

            checkCKR(proc(slotID, ref slotInfo));

            return(slotInfo);
        }
Example #2
0
 public static void PKCS11_init(string lib)
 {
     initialize          = CreateDynamicDllInvoke <C_Initialize>("C_Initialize", lib);
     open_session        = CreateDynamicDllInvoke <C_OpenSession>("C_OpenSession", lib);
     close_session       = CreateDynamicDllInvoke <C_CloseSession>("C_CloseSession", lib);
     login               = CreateDynamicDllInvoke <C_Login>("C_Login", lib);
     logout              = CreateDynamicDllInvoke <C_Logout>("C_Logout", lib);
     create_object       = CreateDynamicDllInvoke <C_CreateObject>("C_CreateObject", lib);
     get_slot_list       = CreateDynamicDllInvoke <C_GetSlotList>("C_GetSlotList", lib);
     get_attribute_value = CreateDynamicDllInvoke <C_GetAttributeValue>("C_GetAttributeValue", lib);
     get_mechanism_list  = CreateDynamicDllInvoke <C_GetMechanismList>("C_GetMechanismList", lib);
     get_slot_info       = CreateDynamicDllInvoke <C_GetSlotInfo>("C_GetSlotInfo", lib);
     get_token_info      = CreateDynamicDllInvoke <C_GetTokenInfo>("C_GetTokenInfo", lib);
     get_session_info    = CreateDynamicDllInvoke <C_GetSessionInfo>("C_GetSessionInfo", lib);
     get_info            = CreateDynamicDllInvoke <C_GetInfo>("C_GetInfo", lib);
     open_session        = CreateDynamicDllInvoke <C_OpenSession>("C_OpenSession", lib);
     close_session       = CreateDynamicDllInvoke <C_CloseSession>("C_CloseSession", lib);
     find_objects_init   = CreateDynamicDllInvoke <C_FindObjectsInit>("C_FindObjectsInit", lib);
     find_objects        = CreateDynamicDllInvoke <C_FindObjects>("C_FindObjects", lib);
     find_objects_final  = CreateDynamicDllInvoke <C_FindObjectsFinal>("C_FindObjectsFinal", lib);
     sign           = CreateDynamicDllInvoke <C_Sign>("C_Sign", lib);
     destroy_object = CreateDynamicDllInvoke <C_DestroyObject>("C_DestroyObject", lib);
     finalize       = CreateDynamicDllInvoke <C_Finalize>("C_Finalize", lib);
 }