use of com.intel.mtwilson.datatypes.File in project OpenAttestation by OpenAttestation.
the class Global method cacerts.
public static List<X509Certificate> cacerts() {
if (cacerts == null) {
log.debug("Loading CA cert...");
FileDAO fileDao = null;
try {
fileDao = TagJdbi.fileDao();
File cacertFile = fileDao.findByName("cacerts");
if (cacertFile == null) {
log.debug("Cannot find 'cacert' file");
} else {
cacerts = X509Util.decodePemCertificates(new String(cacertFile.getContent(), "UTF-8"));
}
} catch (Exception e) {
log.error("Cannot load cacerts", e);
cacerts = null;
} finally {
if (fileDao != null) {
fileDao.close();
}
}
}
return cacerts;
}
Aggregations