Esempio n. 1
0
        /// <summary>
        /// Creates new instance of Pkcs11Slot class
        /// </summary>
        /// <param name="slot">High level PKCS#11 slot</param>
        /// <param name="storeContext">Internal context for Pkcs11X509Store class</param>
        internal Pkcs11Slot(ISlot slot, Pkcs11X509StoreContext storeContext)
        {
            if (slot == null)
            {
                throw new ArgumentNullException(nameof(slot));
            }

            if (storeContext == null)
            {
                throw new ArgumentNullException(nameof(storeContext));
            }

            _slotContext = this.GetSlotContext(slot, storeContext);
            _token       = this.GetToken();
        }
Esempio n. 2
0
        /// <summary>
        /// Disposes object
        /// </summary>
        /// <param name="disposing">Flag indicating whether managed resources should be disposed</param>
        protected virtual void Dispose(bool disposing)
        {
            if (!_disposed)
            {
                if (disposing)
                {
                    // Dispose managed objects

                    if (_token != null)
                    {
                        _token.Dispose();
                        _token = null;
                    }
                }

                // Dispose unmanaged objects

                _disposed = true;
            }
        }