@Test public void testGetServerAliasesReturnsGivenAliasOnly() { String wrapperAlias = "wrapperAlias"; String[] delegateAliases = new String[] { "a", "b", wrapperAlias}; X509ExtendedKeyManager mock = mock(X509ExtendedKeyManager.class); when(mock.getServerAliases(any(String.class), any(Principal[].class))).thenReturn(delegateAliases); X509ExtendedKeyManager wrapper = new X509AliasKeyManager(wrapperAlias, mock); assertArrayEquals("Expected array containing only the wrapper alias", new String[] { wrapperAlias }, wrapper.getServerAliases("", new Principal[0])); }
@Override public String[] getServerAliases(String keyType, Principal[] issuers) { return new String[] { alias }; }
X509AliasKeyManager extends X509ExtendedKeyManager { @Override public String[] getServerAliases(String keyType, Principal[] issuers) { return new String[] { alias }; } }
X509AliasKeyManager extends X509ExtendedKeyManager { @Override public String[] getServerAliases(String keyType, Principal[] issuers) { return new String[] { alias }; } X509AliasKeyManager(String alias, X509ExtendedKeyManager delegate); }
X509AliasKeyManager extends X509ExtendedKeyManager { @Override public String[] getServerAliases(String keyType, Principal[] issuers) { return new String[] { 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 String[] getServerAliases(String keyType, Principal[] issuers) { return new String[] { 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);  }