/// <summary> /// Loads PCKS#11 library /// </summary> /// <param name="libraryPath">Library name or path</param> public Pkcs11(string libraryPath) { try { if (!string.IsNullOrEmpty(libraryPath)) _libraryHandle = UnmanagedLibrary.Load(libraryPath); _delegates = new Delegates(_libraryHandle, true); } catch { Release(); throw; } }
/// <summary> /// Loads PCKS#11 library /// </summary> /// <param name="libraryPath">Library name or path</param> /// <param name="useGetFunctionList">Flag indicating whether cryptoki function pointers should be acquired via C_GetFunctionList (true) or via platform native function (false)</param> public Pkcs11(string libraryPath, bool useGetFunctionList) { try { if (!string.IsNullOrEmpty(libraryPath)) _libraryHandle = UnmanagedLibrary.Load(libraryPath); _delegates = new Delegates(_libraryHandle, useGetFunctionList); } catch { Release(); throw; } }