@Test public void testFilterValidNull() throws Exception { final Collection<X509Certificate> input = null; final Collection<X509Certificate> result = CertificateUtils.filterValid( input ); Assert.assertTrue( result.isEmpty() ); }
public static Set<X509Certificate> filterValid( X509Certificate... certificates ) { final Set<X509Certificate> results = new HashSet<>(); if (certificates != null) { for ( X509Certificate certificate : certificates ) { if ( certificate == null ) { continue; } try { certificate.checkValidity(); } catch ( CertificateExpiredException | CertificateNotYetValidException e ) { continue; } results.add( certificate ); } } return results; }
CertificateUtils { public static Set<X509Certificate> filterValid( X509Certificate... certificates ) { final Set<X509Certificate> results = new HashSet<>(); if (certificates != null) { for ( X509Certificate certificate : certificates ) { if ( certificate == null ) { continue; } try { certificate.checkValidity(); } catch ( CertificateExpiredException | CertificateNotYetValidException e ) { continue; } results.add( certificate ); } } return results; } }
CertificateUtils { public static Set<X509Certificate> filterValid( X509Certificate... certificates ) { final Set<X509Certificate> results = new HashSet<>(); if (certificates != null) { for ( X509Certificate certificate : certificates ) { if ( certificate == null ) { continue; } try { certificate.checkValidity(); } catch ( CertificateExpiredException | CertificateNotYetValidException e ) { continue; } results.add( certificate ); } } return results; }  }
CertificateUtils { public static Set<X509Certificate> filterValid( X509Certificate... certificates ) { final Set<X509Certificate> results = new HashSet<>(); if (certificates != null) { for ( X509Certificate certificate : certificates ) { if ( certificate == null ) { continue; } try { certificate.checkValidity(); } catch ( CertificateExpiredException | CertificateNotYetValidException e ) { continue; } results.add( certificate ); } } return results; }  static Set<X509Certificate> filterValid( X509Certificate... certificates ); static Set<X509Certificate> filterValid( Collection<X509Certificate> certificates ); static Set<TrustAnchor> toTrustAnchors( X509Certificate... certificates ); static Set<TrustAnchor> toTrustAnchors( Collection<X509Certificate> certificates ); static List<X509Certificate> order( Collection<X509Certificate> certificates ); static X509Certificate identifyEndEntityCertificate( Collection<X509Certificate> chain ); static Date findValidPointInTime( X509Certificate... chain ); }
CertificateUtils { public static Set<X509Certificate> filterValid( X509Certificate... certificates ) { final Set<X509Certificate> results = new HashSet<>(); if (certificates != null) { for ( X509Certificate certificate : certificates ) { if ( certificate == null ) { continue; } try { certificate.checkValidity(); } catch ( CertificateExpiredException | CertificateNotYetValidException e ) { continue; } results.add( certificate ); } } return results; }  static Set<X509Certificate> filterValid( X509Certificate... certificates ); static Set<X509Certificate> filterValid( Collection<X509Certificate> certificates ); static Set<TrustAnchor> toTrustAnchors( X509Certificate... certificates ); static Set<TrustAnchor> toTrustAnchors( Collection<X509Certificate> certificates ); static List<X509Certificate> order( Collection<X509Certificate> certificates ); static X509Certificate identifyEndEntityCertificate( Collection<X509Certificate> chain ); static Date findValidPointInTime( X509Certificate... chain );  }