Holds delegates for all PKCS#11 functions
Example #1
0
        /// <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;
            }
        }
Example #2
0
        /// <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;
            }
        }