-1

While trying to carry out an encryption and decryption process on an Android environment, i have the below log.

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.(JCESecurityModule.java:159)

The reason why I will want to make use of JPOS is simply because I will want to carry out a financial transaction, which will be used in packaging my message.

For the encryption and decryption of data, I am to make use of this JCESecurityModule which works well on other platform, but not on the android OS.

NOTE: The file location in my android studio is app/cfg/test.lmk

I was able to get this file from the JPOS-master on github found in the jPOS-master\jPOS-master\jpos\src\test\resources\org\jpos\security

i.e the lmk-test

which was been used this way JCESecurityModule sm = new JCESecurityModule("app/cfg/test.lmk");

I have also tried rebuilidng the lmk file, using the below method

public JCESecurityModule (String lmkFile) throws SMException
    {
        init(null, lmkFile, true);
    }

which can be found in the JCESecurityModule class (JPOS) was still having same issue in loading the lmk file Thanks

4

2 回答 2

0

为了完整起见,这也是在 jPOS 的 Google Group 上提出的,并在那里进行了讨论。https://groups.google.com/forum/#!topic/jpos-users/X3r_PX7lgd4

于 2016-09-22T13:28:06.930 回答
0

加密是由连接到手机以进行交易的设备完成的,但设备制造商实际上是这样做的,以提供您正在规避的端到端加密。您不需要设备中的 jpos。您需要在集中部署的服务器上使用它,在那里您将使用真正的 HSM。

Victor Salaman 在 JPOS 用户 google 组https://groups.google.com/forum/#!topic/jpos-users/X3r_PX7lgd4

但是您仍然可以使用其他一些模块而不是 JCESecurityModule 来执行加密和解密(如果问题仍然存在)。例如使用 SunJCE

于 2016-09-22T17:18:22.937 回答