10-10-2018 02:40 AM
Hi All,
I want to retrieve the private key stored in Jks file using the java KeyStore class in script snap.
I have uploaded the Jks file in the files section of my project. Now, using the FileInputStream I try to load the jks file in Script snap, but I always get the error that “No such file or directory found”. I have tried various permutations for the file path but in vain. Could someone help me and suggest what should be the file path. Or is there any other way to read the Jks file.
Below is my python script code :
keystore=java.security.KeyStore.getInstance("JKS")
keyPassword="123456"
charArray=list(keyPassword)
stream =java.io.FileInputStream("sldb:\\\MyFile.jks");
keystore.load(stream,charArray)
10-12-2018 09:20 AM
Hi,
Have you tried to specified project name in the path? I though if we using sldb protocol, looks like we will need using relative path. try to upload the jks into root of shared project and try first one.
Example:
sldb:///shared/MyFile.jks
sldb:///project-name/MyFile.jks
10-15-2018 06:18 PM
Hi, have you tried reading it from the plex hard disk? i.e c:\temp\MyFile.jks or /tmp/MyFile.jks if Linux.