cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Accessing Jks(Java Keystore) file in Script

prachik
New Contributor

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)
2 REPLIES 2

David_Wang
New Contributor II

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

mina
Employee
Employee

Hi, have you tried reading it from the plex hard disk? i.e c:\temp\MyFile.jks or /tmp/MyFile.jks if Linux.