Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Thales HSM Commands

107 views
Skip to first unread message

Mahmoud Yahya

unread,
Nov 20, 2024, 8:03:37 AM11/20/24
to jPOS Users
Hello all, I have an inquiry about any command that has a request containing Byte Key like EO command, I use Key block LMK ,it takes public key (n B) in the request ,in other command I was using a string message request and it worked well , but it's not working with any command that requires a key that it's format is bytes like EO,EW,GK ,I get error codes like B2,A1 and A3.  do I need to use jpos to connect and talk to hsm or there is a more simple way and if I need to use jpos can someone  help by providing how can it be done?                   

---by the way ,We used socket with inputstream,outputstream and bytearrayoutput stream in A0,Ei and GW and it worked well , but it's not working if request has key that is in bytes format.

Mapfunde Venon

unread,
Nov 20, 2024, 8:23:40 AM11/20/24
to jpos-...@googlegroups.com
Hello


Regards
Venon Mapfunde(PMP,Msc Software Engineering,Bsc Computer Science & Mathematics)
Tel:+263 775 091 262
Email:taka...@gmail.com
Skype: venon.mapfunde


On Wed, 20 Nov 2024 at 15:03, Mahmoud Yahya <mahmoud...@gmail.com> wrote:
Hello all, I have an inquiry about any command that has a request containing Byte Key like EO command, I use Key block LMK ,it takes public key (n B) in the request ,in other command I was using a string message request and it worked well , but it's not working with any command that requires a key that it's format is bytes like EO,EW,GK ,I get error codes like B2,A1 and A3.  do I need to use jpos to connect and talk to hsm or there is a more simple way and if I need to use jpos can someone  help by providing how can it be done?                   

---by the way ,We used socket with inputstream,outputstream and bytearrayoutput stream in A0,Ei and GW and it worked well , but it's not working if request has key that is in bytes format.

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/jpos-users/6e5ae1d7-88a0-4b8c-8272-e7fbdf9ad464n%40googlegroups.com.

chhil

unread,
Nov 21, 2024, 3:15:21 AM11/21/24
to jpos-...@googlegroups.com

I speculate but when you convert to bytes are you using a default or the 8589 character set?

Your string may not be getting encoded correctly into bytes where it does not know how to map it to a byte value.

-chhil


Mahmoud Yahya

unread,
Nov 21, 2024, 3:49:51 AM11/21/24
to jPOS Users
Thanks a lot my friends, Chhil I am using the default to change to bytes ,I can change that but the problem that when I convert my request to byte array ,I send it but don't receive any response from the hsm ,I only get response when I send a string so how can I send a byte array to the hsm and receive a response? Thanks in advance

chhil

unread,
Nov 21, 2024, 6:21:14 AM11/21/24
to jpos-...@googlegroups.com
In one of their manuals they show an example using python to convert hex data to binary binary_data = binascii.a2b_hex
Your input public key needs to be a hexstring  and you use ISOUtil.hex2byte to convert it. to a byte array pass the binary data to the command. Give it a try.
You can look at the Thales manuals which provides host command samples.




Chandrasekhar Rout

unread,
Nov 21, 2024, 7:24:04 AM11/21/24
to jpos-...@googlegroups.com

You are trying to import your public key in Thales HSM .
Could you share your byte data that you are sending to HSM .


Mahmoud Yahya

unread,
Nov 21, 2024, 9:02:37 AM11/21/24
to jPOS Users
Thanks a lot everyone , I didn't have the  2-byte message length header in network byte order (big-endian) ,I included it in my bytearray that I am sending to hsm and now it's working , EO command worked and I am doing other commands now , I will send if anything blocked me ,Thanks again everyone.
Reply all
Reply to author
Forward
0 new messages