0

I'm new to HSM, I'm using TCP connection to communicate with 'safenet ProtectHost EFT' HSM. So as for a beginning i tried to call 'HSM_STATUS' method by sending following message.

full message (with header) :

0000 0001 0000 0001 0001 1001 1011 1111 0000 0000 0000 0001 0000 0001

this message can be broken down as follows (in reverse order):

message :

0000 0001 is the 1 byte long command : '01' (function code of HSM_STATUS method is '01')

safenet header :

0000 0000 0000 0001 is the 2 byte long length of the message : '1' (length of the function call '0000 0001' is '1')

0001 1001 1011 1111 is 2 byte long Sequence Number (An arbitrary value in the request message which is returned with the response message and is not interpreted by the ProtectHost EFT).

0000 0001 is the 1 byte long version number(binary 1 as in the manual)

0000 0001 is the 1 byte long ASCII Start of Header character (Hex 01)

But the HSM does not give any output for this message.

Could anyone please tell what might be the reason for this? Am i doing something wrong in forming this message?

Chathura Wijeweera
  • 289
  • 1
  • 2
  • 9

1 Answers1

0

Even I faced the same issue and resolved it.The root cause for this is that the HSM expects the user to provide the accurate length of Input.

That is the SOH value needs to be accurately of 1 byte length,where as your input is of 4 bytes length.So the following input to HSM will give you correct output :

String command = "01"// SOH + "01"// version + "00"// arbitary value
+ "00"// arbitary value + "00"// length + "01"// length + "01" ; // function call

Hope this helps :)

user3729090
  • 25
  • 1
  • 8