@Test void engineGetTrustManagers_nullSupplier() { X509Source source = new X509SourceStub(); try { new SpiffeTrustManagerFactory().engineGetTrustManagers(source, null); } catch (NullPointerException e) { assertEquals("acceptedSpiffeIdsSupplier is marked non-null but is null", e.getMessage()); } }
@Override public TrustManager[] engineGetTrustManagers() { final X509Source x509Source; try { x509Source = X509SourceManager.getX509Source(); } catch (X509SourceException e) { throw new SpiffeProviderException("The X.509 source could not be created", e); } catch (SocketEndpointAddressException e) { throw new SpiffeProviderException("The Workload API Socket endpoint address configured is not valid", e); } final SpiffeTrustManager spiffeTrustManager; if (ACCEPT_ANY_SPIFFE_ID) { spiffeTrustManager = new SpiffeTrustManager(x509Source); } else { spiffeTrustManager = new SpiffeTrustManager(x509Source, DEFAULT_SPIFFE_ID_SET_SUPPLIER); } return new TrustManager[]{spiffeTrustManager}; }
SpiffeTrustManagerFactory extends TrustManagerFactorySpi { @Override public TrustManager[] engineGetTrustManagers() { final X509Source x509Source; try { x509Source = X509SourceManager.getX509Source(); } catch (X509SourceException e) { throw new SpiffeProviderException("The X.509 source could not be created", e); } catch (SocketEndpointAddressException e) { throw new SpiffeProviderException("The Workload API Socket endpoint address configured is not valid", e); } final SpiffeTrustManager spiffeTrustManager; if (ACCEPT_ANY_SPIFFE_ID) { spiffeTrustManager = new SpiffeTrustManager(x509Source); } else { spiffeTrustManager = new SpiffeTrustManager(x509Source, DEFAULT_SPIFFE_ID_SET_SUPPLIER); } return new TrustManager[]{spiffeTrustManager}; } }
SpiffeTrustManagerFactory extends TrustManagerFactorySpi { @Override public TrustManager[] engineGetTrustManagers() { final X509Source x509Source; try { x509Source = X509SourceManager.getX509Source(); } catch (X509SourceException e) { throw new SpiffeProviderException("The X.509 source could not be created", e); } catch (SocketEndpointAddressException e) { throw new SpiffeProviderException("The Workload API Socket endpoint address configured is not valid", e); } final SpiffeTrustManager spiffeTrustManager; if (ACCEPT_ANY_SPIFFE_ID) { spiffeTrustManager = new SpiffeTrustManager(x509Source); } else { spiffeTrustManager = new SpiffeTrustManager(x509Source, DEFAULT_SPIFFE_ID_SET_SUPPLIER); } return new TrustManager[]{spiffeTrustManager}; }  }
SpiffeTrustManagerFactory extends TrustManagerFactorySpi { @Override public TrustManager[] engineGetTrustManagers() { final X509Source x509Source; try { x509Source = X509SourceManager.getX509Source(); } catch (X509SourceException e) { throw new SpiffeProviderException("The X.509 source could not be created", e); } catch (SocketEndpointAddressException e) { throw new SpiffeProviderException("The Workload API Socket endpoint address configured is not valid", e); } final SpiffeTrustManager spiffeTrustManager; if (ACCEPT_ANY_SPIFFE_ID) { spiffeTrustManager = new SpiffeTrustManager(x509Source); } else { spiffeTrustManager = new SpiffeTrustManager(x509Source, DEFAULT_SPIFFE_ID_SET_SUPPLIER); } return new TrustManager[]{spiffeTrustManager}; }  @Override TrustManager[] engineGetTrustManagers(); TrustManager[] engineGetTrustManagers(@NonNull final BundleSource<X509Bundle> x509BundleSource); TrustManager[] engineGetTrustManagersAcceptAnySpiffeId(@NonNull final BundleSource<X509Bundle> x509BundleSource); TrustManager[] engineGetTrustManagers(
            @NonNull final BundleSource<X509Bundle> x509BundleSource,
            @NonNull final Supplier<Set<SpiffeId>> acceptedSpiffeIdsSupplier); }
SpiffeTrustManagerFactory extends TrustManagerFactorySpi { @Override public TrustManager[] engineGetTrustManagers() { final X509Source x509Source; try { x509Source = X509SourceManager.getX509Source(); } catch (X509SourceException e) { throw new SpiffeProviderException("The X.509 source could not be created", e); } catch (SocketEndpointAddressException e) { throw new SpiffeProviderException("The Workload API Socket endpoint address configured is not valid", e); } final SpiffeTrustManager spiffeTrustManager; if (ACCEPT_ANY_SPIFFE_ID) { spiffeTrustManager = new SpiffeTrustManager(x509Source); } else { spiffeTrustManager = new SpiffeTrustManager(x509Source, DEFAULT_SPIFFE_ID_SET_SUPPLIER); } return new TrustManager[]{spiffeTrustManager}; }  @Override TrustManager[] engineGetTrustManagers(); TrustManager[] engineGetTrustManagers(@NonNull final BundleSource<X509Bundle> x509BundleSource); TrustManager[] engineGetTrustManagersAcceptAnySpiffeId(@NonNull final BundleSource<X509Bundle> x509BundleSource); TrustManager[] engineGetTrustManagers(
            @NonNull final BundleSource<X509Bundle> x509BundleSource,
            @NonNull final Supplier<Set<SpiffeId>> acceptedSpiffeIdsSupplier);  }