List of usage examples for javax.net.ssl X509KeyManager getClientAliases
public String[] getClientAliases(String keyType, Principal[] issuers);
From source file:de.betterform.connector.http.ssl.BetterFORMKeyStoreManager.java
public String[] getClientAliases(String keyType, Principal[] principals) { String[] customClientAliases = null; Iterator<X509KeyManager> iterator = this.customX509KeyManagers.iterator(); while (iterator.hasNext()) { X509KeyManager x509KeyManager = iterator.next(); customClientAliases = (String[]) ArrayUtils.addAll(customClientAliases, x509KeyManager.getClientAliases(keyType, principals)); }/*from www. ja v a 2 s. co m*/ return (String[]) ArrayUtils.addAll(customClientAliases, javaDefaultKeyManager.getClientAliases(keyType, principals)); }
From source file:org.codice.ddf.cxf.SecureCxfClientFactoryTest.java
@Test public void testAliasSelectorKeyManager() { X509KeyManager keyManager = mock(X509KeyManager.class); String alias = "testAlias"; String[] aliases = new String[] { alias }; when(keyManager.chooseClientAlias(any(), any(), any())).thenReturn(alias); when(keyManager.getClientAliases(any(), any())).thenReturn(aliases); AliasSelectorKeyManager aliasSelectorKeyManager = new AliasSelectorKeyManager(keyManager, alias); String chosenAlias = aliasSelectorKeyManager.chooseClientAlias(new String[] { "x509" }, null, null); assertThat(chosenAlias, is(alias));/*from www . j a v a 2 s. c om*/ }