@Test public void testLoadCertificateFromTrustStore() throws IOException, GeneralSecurityException { List<X509Certificate> certs = PemReader.readCertificateChain( x509TestContext.getTrustStoreFile(KeyStoreFileType.PEM)); Assert.assertEquals(1, certs.size()); Assert.assertEquals(x509TestContext.getTrustStoreCertificate(), certs.get(0)); }
public static List<X509Certificate> readCertificateChain(File certificateChainFile) throws IOException, GeneralSecurityException { String contents = new String(Files.readAllBytes(certificateChainFile.toPath()), US_ASCII); return readCertificateChain(contents); }
PemReader { public static List<X509Certificate> readCertificateChain(File certificateChainFile) throws IOException, GeneralSecurityException { String contents = new String(Files.readAllBytes(certificateChainFile.toPath()), US_ASCII); return readCertificateChain(contents); } }
PemReader { public static List<X509Certificate> readCertificateChain(File certificateChainFile) throws IOException, GeneralSecurityException { String contents = new String(Files.readAllBytes(certificateChainFile.toPath()), US_ASCII); return readCertificateChain(contents); } private  PemReader(); }
PemReader { public static List<X509Certificate> readCertificateChain(File certificateChainFile) throws IOException, GeneralSecurityException { String contents = new String(Files.readAllBytes(certificateChainFile.toPath()), US_ASCII); return readCertificateChain(contents); } private  PemReader(); static KeyStore loadTrustStore(File certificateChainFile); static KeyStore loadKeyStore(File certificateChainFile, File privateKeyFile, Optional<String> keyPassword); static List<X509Certificate> readCertificateChain(File certificateChainFile); static List<X509Certificate> readCertificateChain(String certificateChain); static PrivateKey loadPrivateKey(File privateKeyFile, Optional<String> keyPassword); static PrivateKey loadPrivateKey(String privateKey, Optional<String> keyPassword); static PublicKey loadPublicKey(File publicKeyFile); static PublicKey loadPublicKey(String publicKey); }
PemReader { public static List<X509Certificate> readCertificateChain(File certificateChainFile) throws IOException, GeneralSecurityException { String contents = new String(Files.readAllBytes(certificateChainFile.toPath()), US_ASCII); return readCertificateChain(contents); } private  PemReader(); static KeyStore loadTrustStore(File certificateChainFile); static KeyStore loadKeyStore(File certificateChainFile, File privateKeyFile, Optional<String> keyPassword); static List<X509Certificate> readCertificateChain(File certificateChainFile); static List<X509Certificate> readCertificateChain(String certificateChain); static PrivateKey loadPrivateKey(File privateKeyFile, Optional<String> keyPassword); static PrivateKey loadPrivateKey(String privateKey, Optional<String> keyPassword); static PublicKey loadPublicKey(File publicKeyFile); static PublicKey loadPublicKey(String publicKey);  }