@Test public void testToX509CertificatesList() throws Exception { List<Certificate> list = new ArrayList<Certificate>(clientChainExtUsageList); List<X509Certificate> x509List = CertPathUtil.toX509CertificatesList(list); assertEquals(list, x509List); }
public static List<X509Certificate> toX509CertificatesList(List<? extends Certificate> certificates) { if (certificates == null) { throw new NullPointerException("Certificates list must not be null!"); } List<X509Certificate> chain = new ArrayList<>(certificates.size()); for (Certificate cert : certificates) { if (!(cert instanceof X509Certificate)) { throw new IllegalArgumentException("Given certificate is not X.509! " + cert); } chain.add((X509Certificate) cert); } return chain; }
CertPathUtil { public static List<X509Certificate> toX509CertificatesList(List<? extends Certificate> certificates) { if (certificates == null) { throw new NullPointerException("Certificates list must not be null!"); } List<X509Certificate> chain = new ArrayList<>(certificates.size()); for (Certificate cert : certificates) { if (!(cert instanceof X509Certificate)) { throw new IllegalArgumentException("Given certificate is not X.509! " + cert); } chain.add((X509Certificate) cert); } return chain; } }
CertPathUtil { public static List<X509Certificate> toX509CertificatesList(List<? extends Certificate> certificates) { if (certificates == null) { throw new NullPointerException("Certificates list must not be null!"); } List<X509Certificate> chain = new ArrayList<>(certificates.size()); for (Certificate cert : certificates) { if (!(cert instanceof X509Certificate)) { throw new IllegalArgumentException("Given certificate is not X.509! " + cert); } chain.add((X509Certificate) cert); } return chain; }  }
CertPathUtil { public static List<X509Certificate> toX509CertificatesList(List<? extends Certificate> certificates) { if (certificates == null) { throw new NullPointerException("Certificates list must not be null!"); } List<X509Certificate> chain = new ArrayList<>(certificates.size()); for (Certificate cert : certificates) { if (!(cert instanceof X509Certificate)) { throw new IllegalArgumentException("Given certificate is not X.509! " + cert); } chain.add((X509Certificate) cert); } return chain; }  static boolean canBeUsedToVerifySignature(X509Certificate cert); static boolean canBeUsedForAuthentication(X509Certificate cert, boolean client); static CertPath generateCertPath(List<X509Certificate> certificateChain); static CertPath generateCertPath(List<X509Certificate> certificateChain, int size); static CertPath generateValidatableCertPath(List<X509Certificate> certificateChain,
			List<X500Principal> certificateAuthorities); static CertPath validateCertificatePath(boolean truncateCertificatePath, CertPath certPath,
			X509Certificate[] trustedCertificates); static List<X509Certificate> toX509CertificatesList(List<? extends Certificate> certificates); static List<X500Principal> toSubjects(List<X509Certificate> certificates); }
CertPathUtil { public static List<X509Certificate> toX509CertificatesList(List<? extends Certificate> certificates) { if (certificates == null) { throw new NullPointerException("Certificates list must not be null!"); } List<X509Certificate> chain = new ArrayList<>(certificates.size()); for (Certificate cert : certificates) { if (!(cert instanceof X509Certificate)) { throw new IllegalArgumentException("Given certificate is not X.509! " + cert); } chain.add((X509Certificate) cert); } return chain; }  static boolean canBeUsedToVerifySignature(X509Certificate cert); static boolean canBeUsedForAuthentication(X509Certificate cert, boolean client); static CertPath generateCertPath(List<X509Certificate> certificateChain); static CertPath generateCertPath(List<X509Certificate> certificateChain, int size); static CertPath generateValidatableCertPath(List<X509Certificate> certificateChain,
			List<X500Principal> certificateAuthorities); static CertPath validateCertificatePath(boolean truncateCertificatePath, CertPath certPath,
			X509Certificate[] trustedCertificates); static List<X509Certificate> toX509CertificatesList(List<? extends Certificate> certificates); static List<X500Principal> toSubjects(List<X509Certificate> certificates);  }