@Test void engineGetKeyManagers_passingAX509SvidSource() throws URISyntaxException, X509SvidException { Path cert = Paths.get(toUri("testdata/cert.pem")); Path key = Paths.get(toUri("testdata/key.pem")); X509Svid svid = X509Svid.load(cert, key); X509SvidSource x509SvidSource = () -> svid; KeyManager[] keyManagers = new SpiffeKeyManagerFactory().engineGetKeyManagers(x509SvidSource); SpiffeKeyManager keyManager = (SpiffeKeyManager) keyManagers[0]; assertEquals(svid.getChainArray()[0], keyManager.getCertificateChain(DEFAULT_ALIAS)[0]); }
@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);  }