@Test public void testGetPrivateKeyDelegates() { String wrapperAlias = "wrapperAlias"; PrivateKey mockKey = mock(PrivateKey.class); X509ExtendedKeyManager mock = mock(X509ExtendedKeyManager.class); when(mock.getPrivateKey(any(String.class))).thenReturn(mockKey); X509ExtendedKeyManager wrapper = new X509AliasKeyManager(wrapperAlias, mock); assertSame("Different object returned", mockKey, wrapper.getPrivateKey(wrapperAlias)); }
@Override public PrivateKey getPrivateKey(String alias) { return delegate.getPrivateKey(alias); }
X509AliasKeyManager extends X509ExtendedKeyManager { @Override public PrivateKey getPrivateKey(String alias) { return delegate.getPrivateKey(alias); } }
X509AliasKeyManager extends X509ExtendedKeyManager { @Override public PrivateKey getPrivateKey(String alias) { return delegate.getPrivateKey(alias); } X509AliasKeyManager(String alias, X509ExtendedKeyManager delegate); }
X509AliasKeyManager extends X509ExtendedKeyManager { @Override public PrivateKey getPrivateKey(String alias) { return delegate.getPrivateKey(alias); } X509AliasKeyManager(String alias, X509ExtendedKeyManager delegate); @Override String chooseClientAlias(String[] keyType, Principal[] issuers, Socket socket); @Override String chooseServerAlias(String keyType, Principal[] issuers, Socket socket); @Override X509Certificate[] getCertificateChain(String alias); @Override String[] getClientAliases(String keyType, Principal[] issuers); @Override PrivateKey getPrivateKey(String alias); @Override String[] getServerAliases(String keyType, Principal[] issuers); @Override String chooseEngineClientAlias(String[] keyType, Principal[] issuers, SSLEngine engine); @Override String chooseEngineServerAlias(String keyType, Principal[] issuers, SSLEngine engine); }
X509AliasKeyManager extends X509ExtendedKeyManager { @Override public PrivateKey getPrivateKey(String alias) { return delegate.getPrivateKey(alias); } X509AliasKeyManager(String alias, X509ExtendedKeyManager delegate); @Override String chooseClientAlias(String[] keyType, Principal[] issuers, Socket socket); @Override String chooseServerAlias(String keyType, Principal[] issuers, Socket socket); @Override X509Certificate[] getCertificateChain(String alias); @Override String[] getClientAliases(String keyType, Principal[] issuers); @Override PrivateKey getPrivateKey(String alias); @Override String[] getServerAliases(String keyType, Principal[] issuers); @Override String chooseEngineClientAlias(String[] keyType, Principal[] issuers, SSLEngine engine); @Override String chooseEngineServerAlias(String keyType, Principal[] issuers, SSLEngine engine);  }