@Test void engineGetKeyManagers_usingX509SourceManager() throws NoSuchFieldException, IllegalAccessException { Field field = X509SourceManager.class.getDeclaredField("x509Source"); field.setAccessible(true); X509Source source = new X509SourceStub(); field.set(null, source); KeyManager[] keyManagers = new SpiffeKeyManagerFactory().engineGetKeyManagers(); SpiffeKeyManager keyManager = (SpiffeKeyManager) keyManagers[0]; X509Certificate[] chain = keyManager.getCertificateChain(DEFAULT_ALIAS); X509Certificate certificate = chain[0]; assertEquals(source.getX509Svid().getChain().get(0), certificate); }
@Override protected KeyManager[] engineGetKeyManagers() { val x509Source = getX509Source(); val spiffeKeyManager = new SpiffeKeyManager(x509Source); return new KeyManager[]{spiffeKeyManager}; }
SpiffeKeyManagerFactory extends KeyManagerFactorySpi { @Override protected KeyManager[] engineGetKeyManagers() { val x509Source = getX509Source(); val spiffeKeyManager = new SpiffeKeyManager(x509Source); return new KeyManager[]{spiffeKeyManager}; } }
SpiffeKeyManagerFactory extends KeyManagerFactorySpi { @Override protected KeyManager[] engineGetKeyManagers() { val x509Source = getX509Source(); val spiffeKeyManager = new SpiffeKeyManager(x509Source); return new KeyManager[]{spiffeKeyManager}; }  }
SpiffeKeyManagerFactory extends KeyManagerFactorySpi { @Override protected KeyManager[] engineGetKeyManagers() { val x509Source = getX509Source(); val spiffeKeyManager = new SpiffeKeyManager(x509Source); return new KeyManager[]{spiffeKeyManager}; }  KeyManager[] engineGetKeyManagers(@NonNull final X509SvidSource x509SvidSource); }
SpiffeKeyManagerFactory extends KeyManagerFactorySpi { @Override protected KeyManager[] engineGetKeyManagers() { val x509Source = getX509Source(); val spiffeKeyManager = new SpiffeKeyManager(x509Source); return new KeyManager[]{spiffeKeyManager}; }  KeyManager[] engineGetKeyManagers(@NonNull final X509SvidSource x509SvidSource);  }