Esempio n. 1
0
        /// <inheritdoc />
        /// <summary>
        /// Introduce additional alias of given device to the smart card resource manager.
        /// </summary>
        /// <param name="readerName">Additional name for the device.</param>
        /// <param name="deviceName">Name of the device.</param>
        public void IntroduceReader(string readerName, string deviceName)
        {
            var nullTerminatedBytesArray1 = BinaryHelper.ConvertNullTerminatedByteArrayFromString(Encoding, readerName).ToArray();
            var nullTerminatedBytesArray2 = BinaryHelper.ConvertNullTerminatedByteArrayFromString(Encoding, deviceName).ToArray();

            WinSCardWrapper.IntroduceReader(Handle, nullTerminatedBytesArray1, nullTerminatedBytesArray2);
        }
Esempio n. 2
0
        /// <inheritdoc />
        /// <summary>
        /// Removes reader form the group.
        /// </summary>
        /// <param name="readerName">Name of the reader.</param>
        /// <param name="groupName">Name of the group.</param>
        public void RemoveReaderFromGroup(string readerName, string groupName)
        {
            var nullTerminatedBytesArray1 = BinaryHelper.ConvertNullTerminatedByteArrayFromString(Encoding, readerName).ToArray();
            var nullTerminatedBytesArray2 = BinaryHelper.ConvertNullTerminatedByteArrayFromString(Encoding, groupName).ToArray();

            WinSCardWrapper.RemoveReaderFromGroup(Handle, nullTerminatedBytesArray1, nullTerminatedBytesArray2);
        }
        public void Connect(ReaderSharingMode mode, Protocol preferredProtocol)
        {
            var readerNameBytes = BinaryHelper.ConvertNullTerminatedByteArrayFromString(Encoding, PcscReaderName);
            var connectResult   = WinSCardWrapper.Connect(ContextHandler.Instance.Handle, readerNameBytes.ToArray(), mode, preferredProtocol);

            Handle         = connectResult.ConnectionHandle;
            ActiveProtocol = connectResult.Protocol;
            ConnectionMode = mode;
        }
Esempio n. 4
0
        /// <inheritdoc />
        /// <summary>
        /// Removes reader from the smart card resource manager.
        /// </summary>
        /// <param name="readerName">Name of the reader.</param>
        public void ForgetReader(string readerName)
        {
            var nullTerminatedBytesArray1 = BinaryHelper.ConvertNullTerminatedByteArrayFromString(Encoding, readerName).ToArray();

            WinSCardWrapper.ForgetReader(Handle, nullTerminatedBytesArray1);
        }
Esempio n. 5
0
        /// <inheritdoc />
        /// <summary>
        /// Deletes reader group from smart card resource manager.
        /// </summary>
        /// <param name="groupName">Name of the reader group.</param>
        public void ForgetReaderGroup(string groupName)
        {
            var nullTerminatedBytesArray = BinaryHelper.ConvertNullTerminatedByteArrayFromString(Encoding, groupName).ToArray();

            WinSCardWrapper.ForgetReaderGroup(Handle, nullTerminatedBytesArray);
        }