Getting Issue with Terminal Master Key with NIBSS

77 views
Skip to first unread message

Sohan Soni (IWT)

unread,
Mar 1, 2023, 8:44:48 AM3/1/23
to jPOS Users
Respected Group Members

We are struggling with the Terminal Master Key download option. We want to get the correct flow for NIBSS


Please note the steps we performed

1. From IP and port provided by NIBSS, We downloaded .pem file
2. Installed Trust certificate in Urovo POS
3. Used CSChannel Connect with IP and PORT, Also added packager Postpackager
4. Created ISO 8583 Message for TMK download
5. Set max packet length to 99999
6. Connected Channel and send the ISO message there
7. Received the response from the channel and disconnected the client.

Here on Receive, We are getting EOFException.

My Concerns and help are required for below points.
1. Where to use component Key 1 and component key 2
2. Do we need to send authorization before sending a request for TMK?
3. Which channel of jpos we should use for NIBSS TMK download?
4. I would really appreciate if you can put all the steps we need to perform.


Mark Salter

unread,
Mar 1, 2023, 1:12:04 PM3/1/23
to jpos-...@googlegroups.com
On 01/03/2023 13:30, Sohan Soni (IWT) wrote:
Please note the steps we performed

1. From IP and port provided by NIBSS, We downloaded .pem file
2. Installed Trust certificate in Urovo POS
3. Used CSChannel Connect with IP and PORT, Also added packager Postpackager
4. Created ISO 8583 Message for TMK download
5. Set max packet length to 99999
Can you explain what you mean/did?

6. Connected Channel and send the ISO message there
Perhaps share code snippet driving this test exchange.

7. Received the response from the channel and disconnected the client.

Reads like you are handcrafting your message  and perhaps not using a Packager and MUx (to wrap the Channel and perform matching)?

This is only a test I figure, but would expect a persistent connection, management of that connectivity and also you to need to use other jPOS components (Mux, Packager etc etc).


Here on Receive, We are getting EOFException.
So the length might be bad for the response, I have to suspect you are getting some form of reject in response, since the length handling on the request and response will be 'reflective' so NIBSS may well have not been able to handle your request and so are returning a correctly constructed (hence length CSChannel can't handle correctly)


My Concerns and help are required for below points.
1. Where to use component Key 1 and component key 2
Ask NIBSS or refer to their documentation.

2. Do we need to send authorization before sending a request for TMK?
Ask NIBSS or refer to their documentation, but I doubt it, perhaps a sign-on is needed (to identify your endpoint into them).

3. Which channel of jpos we should use for NIBSS TMK download?
Ask NIBSS or refer to their documentation to determine the structure and form of the NIBSS length format;  share back here (the description and not any copyright material) and we might advise further.


--

Mark

signature.asc

Sohan Soni (IWT)

unread,
Mar 2, 2023, 2:52:47 AM3/2/23
to jPOS Users
Hello Mark

Thanks for your response. Please check my attached code for TMK download

public void getTmk() {
new Thread(new Runnable() {
public void run() {
Logger logger = new Logger();
logger.addListener (new SimpleLogListener(System.out));
ISOMsg m = new ISOMsg();
try {
/*m.setMTI("0800");
m.set(3, "9A0000");
m.set(7, DateUtil.getDateTime6(new Date()));
m.set(11, MerchantParams.getTraceNum());
m.set(12, DateUtil.getDateTime5(new Date()));
m.set(13, DateUtil.getDateTime4(new Date()));
m.set(41, "Terminal_id");
m.set(48, ISOUtil.hex2byte("001" + "ComponentKey1" + "002" + "ComponentKey2"));*/
m.set (new ISOField (0, "0800"));
m.set (new ISOField (3, "9A0000"));
m.set (new ISOField(7, DateUtil.getDateTime6(new Date())));
m.set (new ISOField (11, MerchantParams.getTraceNum()));
m.set (new ISOField (12, DateUtil.getDateTime5(new Date())));
m.set (new ISOField (13, DateUtil.getDateTime4(new Date())));
m.set (new ISOField (41, "5852D933"));
//byte[] btest = m.pack();
//Log.d("BTest::", btest.toString());
PostChannel channel = new PostChannel(
"196.6.103.10", 55533, new ISO87BPackager()
);
//ISOClientSocketFactory op = channel.getSocketFactory();

Configuration cnf = new Configuration() {
@Override
public String get(String propertyName) {
return null;
}

@Override
public String[] getAll(String propertyName) {
return new String[0];
}

@Override
public int[] getInts(String propertyName) {
return new int[0];
}

@Override
public long[] getLongs(String propertyName) {
return new long[0];
}

@Override
public double[] getDoubles(String propertyName) {
return new double[0];
}

@Override
public boolean[] getBooleans(String propertyName) {
return new boolean[0];
}

@Override
public String get(String propertyName, String defaultValue) {
return null;
}

@Override
public int getInt(String propertyName) {
return 0;
}

@Override
public int getInt(String propertyName, int defaultValue) {
return 0;
}

@Override
public long getLong(String propertyName) {
return 0;
}

@Override
public long getLong(String propertyName, long defaultValue) {
return 0;
}

@Override
public double getDouble(String propertyName) {
return 0;
}

@Override
public double getDouble(String propertyName, double defaultValue) {
return 0;
}

@Override
public boolean getBoolean(String propertyName) {
return false;
}

@Override
public boolean getBoolean(String propertyName, boolean defaultValue) {
return false;
}

@Override
public void put(String name, Object value) {

}

@Override
public Set<String> keySet() {
return null;
}
};
cnf.put("expect-keep-alive", true);
cnf.put("keep-alive", true);
cnf.put("override-header", true);
cnf.put("reply-keepalive", true);
 
channel.setMaxPacketLength(1000000000);
((LogSource)channel).setLogger (logger, "test-channel");
 
channel.setTimeout(60000);
channel.connect();
if(channel.isConnected()){
channel.send(m);
ISOMsg response = channel.receive();
// Extract the terminal key or master key
String terminalKey = response.getString(48);
Log.d("RESPONSE:LL:", terminalKey.toString());
channel.disconnect();
}

} catch (EOFException e){
e.printStackTrace();
} catch (ISOException | IOException e) {
e.printStackTrace();
}
}
}).start();

Mark Salter

unread,
Mar 2, 2023, 3:20:44 AM3/2/23
to jpos-...@googlegroups.com
>> Please check my attached code for TMK downloadI see the Channel I. Use may have evolved, but that is fine pending the share of the other details I suggested collecting.

Have you already selected the Packager based on the interface? If not, then the NIBSS documentation/support should detail the individual field formats and any header needs, so you can then check the Packager in use matches each field their message spec.


-- 
Mark


Sent from Proton Mail mobile



-------- Original Message --------
--
--
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 on the web visit https://groups.google.com/d/msgid/jpos-users/2f0aa1d9-5bd0-4966-b392-702e28e67ce3n%40googlegroups.com.
signature.asc
Reply all
Reply to author
Forward
0 new messages