/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
private boolean isInitialized = false;
// empty
}
try {
} catch (SecurityException se) {
// eat security exceptions but report other throwables
"SunX509: skip default keystore: " + se);
}
"SunX509: skip default keystore: " + err);
}
throw err;
} catch (RuntimeException re) {
"SunX509: skip default keystore: " + re);
}
throw re;
} catch (Exception e) {
"SunX509: skip default keystore: " + e);
}
throw new KeyStoreException(
"problem accessing trust store" + e);
}
}
isInitialized = true;
}
isInitialized = true;
}
/**
* Returns one trust manager for each type of trust material.
*/
if (!isInitialized) {
throw new IllegalStateException(
"TrustManagerFactoryImpl is not initialized");
}
return new TrustManager[] { trustManager };
}
/*
* Try to get an InputStream based on the file we pass in.
*/
throws Exception {
return AccessController.doPrivileged(
new PrivilegedExceptionAction<FileInputStream>() {
try {
return new FileInputStream(file);
} else {
return null;
}
} catch (FileNotFoundException e) {
// couldn't find it, oh well.
return null;
}
}
});
}
/**
* Returns the keystore with the configured CA certificates.
*/
{
"javax.net.ssl.trustStore"));
"java.home"));
"javax.net.ssl.trustStoreType",
KeyStore.getDefaultType()));
"javax.net.ssl.trustStoreProvider", ""));
"javax.net.ssl.trustStorePassword", ""));
return null;
}
});
/*
* Try:
* javax.net.ssl.trustStore (if this variable exists, stop)
* jssecacerts
* cacerts
*
* If none exists, we use an empty keystore.
*/
if (storeFileName != null) {
} else {
+ "security" + sep +
"jssecacerts");
+ "security" + sep +
"cacerts");
}
}
} else {
storeFileName = "No File Available, using empty keystore.";
}
}
}
/*
* Try to initialize trust store.
*/
}
} else {
}
// if trustStore is NONE, fis will be null
// Zero out the temporary password storage
passwd[i] = (char)0;
}
}
}
}
return ks;
}
}
throws InvalidAlgorithmParameterException {
throw new InvalidAlgorithmParameterException
("SunX509 TrustManagerFactory does not use "
+ "ManagerFactoryParameters");
}
}
}
throws InvalidAlgorithmParameterException {
if (spec instanceof CertPathTrustManagerParameters == false) {
throw new InvalidAlgorithmParameterException
("Parameters must be CertPathTrustManagerParameters");
}
if (params instanceof PKIXBuilderParameters == false) {
throw new InvalidAlgorithmParameterException
("Encapsulated parameters must be PKIXBuilderParameters");
}
}
}
}