@Test public void testCertifcateLoad() { String ipFile = resolveFilename("cert.pem.txt"); SslEngineFacadeFactory factory = new SslEngineFacadeFactory(); assertNotNull("Certificate was NULL", factory.readCertificate(ipFile)); }
Certificate readCertificate(String pemFile) { InputStream is = null; try { CertificateFactory cFactory = CertificateFactory.getInstance("X.509"); is = new FileInputStream(pemFile); return cFactory.generateCertificate(is); } catch (CertificateException ce) { String msg = "Failed to load certificate [" + pemFile + "]"; _logger.log(Level.SEVERE, msg, ce); throw new TransportException(msg, ce); } catch (FileNotFoundException e) { String msg = "Certificate file not found [" + pemFile + "]"; _logger.log(Level.SEVERE, msg); throw new TransportException(msg, e); } finally { closeSafely(is); } }
SslEngineFacadeFactory { Certificate readCertificate(String pemFile) { InputStream is = null; try { CertificateFactory cFactory = CertificateFactory.getInstance("X.509"); is = new FileInputStream(pemFile); return cFactory.generateCertificate(is); } catch (CertificateException ce) { String msg = "Failed to load certificate [" + pemFile + "]"; _logger.log(Level.SEVERE, msg, ce); throw new TransportException(msg, ce); } catch (FileNotFoundException e) { String msg = "Certificate file not found [" + pemFile + "]"; _logger.log(Level.SEVERE, msg); throw new TransportException(msg, e); } finally { closeSafely(is); } } }
SslEngineFacadeFactory { Certificate readCertificate(String pemFile) { InputStream is = null; try { CertificateFactory cFactory = CertificateFactory.getInstance("X.509"); is = new FileInputStream(pemFile); return cFactory.generateCertificate(is); } catch (CertificateException ce) { String msg = "Failed to load certificate [" + pemFile + "]"; _logger.log(Level.SEVERE, msg, ce); throw new TransportException(msg, ce); } catch (FileNotFoundException e) { String msg = "Certificate file not found [" + pemFile + "]"; _logger.log(Level.SEVERE, msg); throw new TransportException(msg, e); } finally { closeSafely(is); } } SslEngineFacadeFactory(); }
SslEngineFacadeFactory { Certificate readCertificate(String pemFile) { InputStream is = null; try { CertificateFactory cFactory = CertificateFactory.getInstance("X.509"); is = new FileInputStream(pemFile); return cFactory.generateCertificate(is); } catch (CertificateException ce) { String msg = "Failed to load certificate [" + pemFile + "]"; _logger.log(Level.SEVERE, msg, ce); throw new TransportException(msg, ce); } catch (FileNotFoundException e) { String msg = "Certificate file not found [" + pemFile + "]"; _logger.log(Level.SEVERE, msg); throw new TransportException(msg, e); } finally { closeSafely(is); } } SslEngineFacadeFactory(); ProtonSslEngine createProtonSslEngine(SslDomain domain, SslPeerDetails peerDetails); void resetCache(); }
SslEngineFacadeFactory { Certificate readCertificate(String pemFile) { InputStream is = null; try { CertificateFactory cFactory = CertificateFactory.getInstance("X.509"); is = new FileInputStream(pemFile); return cFactory.generateCertificate(is); } catch (CertificateException ce) { String msg = "Failed to load certificate [" + pemFile + "]"; _logger.log(Level.SEVERE, msg, ce); throw new TransportException(msg, ce); } catch (FileNotFoundException e) { String msg = "Certificate file not found [" + pemFile + "]"; _logger.log(Level.SEVERE, msg); throw new TransportException(msg, e); } finally { closeSafely(is); } } SslEngineFacadeFactory(); ProtonSslEngine createProtonSslEngine(SslDomain domain, SslPeerDetails peerDetails); void resetCache();  }