0

We have a develop to make some things with bank cards. One og them is validate the PIN (we have PAN, PIN, Pinlenght and PINBLOCK); and we have a HSM THALES to validate the PIN.

But, how do we connect whith THLALES appliance? I thought that using a library, nugget o similar, but there are no many documentation in internet.

I know the command to send to HSM, expected response, and similar. But.. i can't find documentation about how to connect whit Hardare module.

Any documentation, connection interface, library o similar.

2 Answers2

0

Greetings at Stack Overflow.

For high-level communication with PKCS#11 module from C# you may use Pkcs11Interop.

For low-level communication with smart-card have a look at this article.

Alexander
  • 1,232
  • 1
  • 15
  • 24
  • but, I still don't understand. Well., i have a applicance with a IP ADRESS and a specific port. To talk with HSMK appliance, i have to open a TCP Socket and send any commando to HSM.. true? – Oscar Plasencia Garcia Nov 21 '22 at 15:50
  • In your question you mentioned that your interface is PKCS#11. TCP Socket is out of that scope. See another answer from Max Bot. – Alexander Nov 22 '22 at 08:29
0

The Thales HSM operates as a TCP server, you need to connect your application as a TCP client to the IP address and port of the HSM; once you connect to the TPC socket you have to send via the socket the command formatted appropriately, before the command you have to enter 2 bytes which represent the length of the command that follows, then there is a header whose length depends on how the relevant 'Header Length' parameter is set in the HSM, then there is the Command Code and the command data; the HSM responds to each command sent, the response consists of 2 bytes of length and then the response message consisting of the Header (which is the same as the one sent as input) the Response code and the Error code, when the Error code is equal to 00 it means that the command was processed correctly.

Max Bot
  • 1
  • 1