コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="slotId"></param>
        /// <returns></returns>
        public CKM[] GetMechanismList(uint slotId)
        {
            C_GetMechanismList proc = (C_GetMechanismList)DelegateUtil.GetDelegate(this.hLib, typeof(C_GetMechanismList));

            uint pulCount = 0;

            checkCKR(proc(slotId, null, ref pulCount));

            CKM[] mechanismList = new CKM[pulCount];

            checkCKR(proc(slotId, mechanismList, ref pulCount));

            return(mechanismList);
        }
コード例 #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);
 }