Fixed leaking file handle problem with regards to the trusted

ATS keystore file.
This commit is contained in:
Juan Carlos Luciani 2008-08-04 22:08:40 +00:00
parent 8179597cf4
commit 456d286506

View File

@ -180,6 +180,7 @@ public final class SecureTokenUtil
{
Map<String,X509Certificate> x509ISNCertMap;
InputStream inStream = null;
FileInputStream fis = null;
try
{
// Load our crypto properties
@ -202,7 +203,7 @@ public final class SecureTokenUtil
// Instantiate and load the keystore
KeyStore keyStore = KeyStore.getInstance(keystoreType);
FileInputStream fis = new FileInputStream(keystoreFile);
fis = new FileInputStream(keystoreFile);
keyStore.load(fis, keystorePass.toCharArray());
// Create the Certificate issuer:sn map
@ -220,9 +221,12 @@ public final class SecureTokenUtil
}
finally
{
// Make sure that the input stream has been closed
// Make sure that the streams have been closed
if (inStream != null)
inStream.close();
if (fis != null)
fis.close();
}
return x509ISNCertMap;