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