We have devoloped a module for PGP Decryption and deployed as a module in our PI 7.1 server .
We have placed the public and private key certificates(Privatekey.txt,PubKey.txt) and jar files (bcpg-jdk15-1.44.jar,bcprov-ext-jdk14-146.jar,bcprov-jdk14-146.jar ) in the below path of our PI FTP server .
In Module while reading the private key file it is failing to read and going to else block and throwing "Key is null"
secretkeylocation = moduleContext.getContextData("SecretKeyLocation"); //Reading the path dynamically from channel
iinKey = getClass().getResourceAsStream(secretkeylocation);
if(inKey == null)
throw new ModuleException("$$$$ key is null $$$$$");
NOTE:We have tried placing the pblic and private key certificates in different folder .But faced same issue again.
Above scenario we have devoloped using java mapping .Here it worked successfully
String privateKeyPath = "/com/sap/pgp/secring.skr"; //placed certificates here
inKey = getClass().getResourceAsStream(privateKeyPath); //Reading the file
Could you plz sugest ?