Using JCESecurityModule on Android device.

238 views
Skip to first unread message

Israel Meshileya

unread,
Sep 21, 2016, 7:06:27 AM9/21/16
to jPOS Users
After successfully implementing JPOS on Android devices, while trying to carry out a method on it too.

was having a little issue loading the Local Master Keys. which is been represented by the log below.

com.s.sdk.security.SMException: Error loading Local Master Keys, file: "/cfg/lmktest.lmk" does not exist. Please specify a valid LMK file, or rebuild a new one.
09-21 11:56:31.792 16182-16182/com.mpos.sdk W/System.err:     at com.s.sdk.security.jceadapter.JCESecurityModule.init(JCESecurityModule.java:1785)
09-21 11:56:31.792 16182-16182/com.mpos.sdk W/System.err:     at com.s.sdk.security.jceadapter.JCESecurityModule.<init>(JCESecurityModule.java:159)

which can be found in the jPOS-master\jPOS-master\jpos\src\test\resources\org\jpos\security
i.e the lmk-test

I do not really know much about the LMK file itself. 
Would so much appreciate any effort in getting this issue resolved.
Thanks

Israel Meshileya

unread,
Sep 21, 2016, 1:47:16 PM9/21/16
to jPOS Users
Greetings to you all from here

Wouldn't mind to know, if there is a way to carrying out my decryption (using my keys), without having to use the lmk and if i am to use it, how well can i make it readable. cos, while trying to carry that out at my own end, i am getting the
Error loading Local Master Keys, file: "/libs/cfg/test.lmk" does not exist. Please specify a valid LMK file, or rebuild a new one

. ...i also tried using the SunJCE, but i prefer using the JCESecurityModule, since i will be using JPOS in packaging my message.

NOTE: running this class as a main class (a single file), without having to build (my application) the apk file, it works well with the part been defined.


Alejandro Revilla

unread,
Sep 21, 2016, 1:49:30 PM9/21/16
to jPOS Users

I suggest you put a valid lmk file. You can create one using the smconsole command in your desktop environment.

Start q2 --cli and then type tab, you’ll see smconsole.




--
--
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
 
Join us in IRC at http://webchat.freenode.net/?channels=jpos
 
You received this message because you are subscribed to the "jPOS Users" group.
Please see http://jpos.org/wiki/JPOS_Mailing_List_Readme_first
To post to this group, send email to jpos-...@googlegroups.com
To unsubscribe, send email to jpos-users+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jpos-users
---
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/009943df-36a0-441c-9428-a644f683a5f2%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

derin...@gmail.com

unread,
Sep 21, 2016, 2:01:14 PM9/21/16
to jPOS Users
Thanks for your time @Alejandro.

I am not using the JPOS as a jar file.  I had to download its source file from github, due to the dalvikvm on android environment not been able to read some of the classes in the JPOS library. So, i had to extract some of the packages i did use in the project.
I wouldn't mind, knowing if there is another way i can use in creating another lmk file to be used.

Thanks once again.


On Wednesday, September 21, 2016 at 6:49:30 PM UTC+1, Alejandro Revilla wrote:

Start q2 --cli and then type tab, you’ll see smconsole.




On Wed, Sep 21, 2016 at 2:47 PM, Israel Meshileya <odunmes...@gmail.com> wrote:
Greetings to you all from here

Wouldn't mind to know, if there is a way to carrying out my decryption (using my keys), without having to use the lmk and if i am to use it, how well can i make it readable. cos, while trying to carry that out at my own end, i am getting the
Error loading Local Master Keys, file: "/libs/cfg/test.lmk" does not exist. Please specify a valid LMK file, or rebuild a new one

. ...i also tried using the SunJCE, but i prefer using the JCESecurityModule, since i will be using JPOS in packaging my message.

NOTE: running this class as a main class (a single file), without having to build (my application) the apk file, it works well with the part been defined.


--
--
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
 
Join us in IRC at http://webchat.freenode.net/?channels=jpos
 
You received this message because you are subscribed to the "jPOS Users" group.
Please see http://jpos.org/wiki/JPOS_Mailing_List_Readme_first
To post to this group, send email to jpos-...@googlegroups.com
To unsubscribe, send email to jpos-users+...@googlegroups.com

For more options, visit this group at http://groups.google.com/group/jpos-users
---
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.

Alejandro Revilla

unread,
Sep 21, 2016, 2:03:18 PM9/21/16
to jPOS Users
But you own a PC you could use for a single time to create an LMK and then copy to your Android environment, right?

that's what I was suggesting.



To unsubscribe, send email to jpos-users+unsubscribe@googlegroups.com

For more options, visit this group at http://groups.google.com/group/jpos-users
---
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/2ee7de2e-4d28-49cd-a736-695f2b59e898%40googlegroups.com.

Israel Meshileya

unread,
Sep 21, 2016, 2:05:08 PM9/21/16
to jPOS Users
I am not using the whole JPOS as a jar file, I extracted some of the files to be used in packaging my messages.
Wouldn't mind to know, if there is a way in creating another lmk to be used in my android environment.

I appreciate your response.
 

On Wednesday, 21 September 2016 18:49:30 UTC+1, Alejandro Revilla wrote:

Victor Salaman

unread,
Sep 21, 2016, 2:15:37 PM9/21/16
to jpos-...@googlegroups.com
I would advise against running this on an android device. For one thing, it will be extremely difficult to comply with your licensing obligations in a widespread device deploy. Another thing is that you are working on a custom build and yet you don't understand the technical aspects and will require extensive support on a topic that frankly is of very little value to the rest of the community. 

Setting that aside, if you read the source code you'll see that you can recreate the LMK... And in Android you might need to modify the class due to not really counting on having a filesystem available.

Just my 2 cents

Sent from my iPhone

Israel Meshileya

unread,
Sep 21, 2016, 2:45:04 PM9/21/16
to jPOS Users
I do appreciate your sincere response to this @Victor.

The reason of me trying to run this on an android environment is... trying to communicate with a Bluetooth enabled card reader, which communicates with Android devices (having its API).
So, in carrying out transactions, I had to use JPOS at my end which I couldn't but have to extract some of the things I needed in packaging my data, since i wasn't able to use its  JAR file.

I have also tried rebuilding the LMK file in the android device, using 
public JCESecurityModule (String lmkFile) throws SMException {
 init
(null, lmkFile, true);

 
}

 but still getting the SMException: Can't generate Local Master Keys  but will try to see, if i can get through it.

Once again, thanks for the explanation.

On Wednesday, 21 September 2016 19:15:37 UTC+1, Victor Salaman wrote:

Victor Salaman

unread,
Sep 21, 2016, 2:48:25 PM9/21/16
to jpos-...@googlegroups.com
The device makers actually do it this way to provide end to end encryption which you are circumventing. You don't need jpos in the device. You need it at your centrally deployed servers, where you would use real HSMs. 

Sent from my iPhone
--
--
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
 
Join us in IRC at http://webchat.freenode.net/?channels=jpos
 
You received this message because you are subscribed to the "jPOS Users" group.
Please see http://jpos.org/wiki/JPOS_Mailing_List_Readme_first
To post to this group, send email to jpos-...@googlegroups.com
To unsubscribe, send email to jpos-users+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jpos-users
---
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.

Israel Meshileya

unread,
Sep 21, 2016, 3:01:29 PM9/21/16
to jPOS Users
Thanks so much for the enlightenment. I do appreciate. 

Thought I could actually wrap it up at my own end, so as to use it (the way it has been defined by the service providers...in the process of being the bridge between the device itself and the service provider).

Thanks so much @Victor, i do appreciate. 
Reply all
Reply to author
Forward
0 new messages