Hi all;
I have a program in windows that is a PKCS#11 library to communicate with a
cryptographic token;
Also, I have multiple programs to implement a device manager using shared
memory and multithreading concepts.
In it’s windows version, it uses a windows-based token driver in low level
and a program (C++ class)
called “SerialWrapper.cpp” to connect to the usb token.
In the “SerialWrapper.cpp”, it uses the “DCB” structure and functions like
“CreateFile” to enumerate and communicate with serial(COM) ports.
I’m going to “PORT” this project to linux, so I use a library named “libusb”
and a program named “hid_LINUX” to enumerate devices(usb tokens) connected
to the system and also Interfaces, endpoints,… and open a handle to them
and write or read from token.
I test the “hid_linux” separately and it works fine.
But in porting “PKCS11 library”, I’ve faced a basic and conceptual problem!!
What’s the differences between a USB port and a COM(serial) port?
In windows-based version of the program, it interacts with COM ports, I was
thinking that COM port is a “9-pin” port at the back of case!
But I can’t understand why we have “COM1, COM2, …,COM9” in such
programming?!
In the windows version of the program, it supports and handles “4” slots
simultanousely.
That is, the program handles four tokens connected to the system, but using
the “SerialWrapper.cpp” to connect to these “USB Tokens”!
And the PKCS11 library supports 4 slots, as well!
But in linux version, I can’t map Serial ports to USB ports conceptually and
this is because I’m not familiar with differences between usb driver model
of windows and linux and this is my first programming experience with buses
or ports!
And I can’t realize the differences between COM port and USB port, BTW on
some laptops we don’t have COM port(9-pin port)!
Does the COM port predicate to USB port too?!
could you explain me these differences pithy and improve my bad
understanding please?
I’m so confused and need the experts’ explanations than searching in the
Internet!!
THX in Advance.