Hi, I am using AES to accomplish symmetric-key encryption. I store the Key in a password protected KeyStore.
the api exposes the following for loading the key from keystore
keyStore.load(inputStream, keyStorePassword.toCharArray());
so everytime when i want to enrypt or decrypt , i have to pass the inputstream which is atleast in my opinion a performance hit as it has to read the content everytime afresh.
Could you anyone please help me out with the strategy of storing it in memory and from then on accessing it and converting to a InputStream?
Note : i did try to read the contents of the keystore to String (UTF-8)and convert it to InputStream and passed it to the api .But it spit out following exception
java.io.IOException: Invalid keystore form