/* * Returns a keystore entry alias and a list of target keystores. * When the supplied alias prefix identifies a keystore then that single * keystore is returned. When no alias prefix is supplied then all the * keystores are returned. */ private AbstractMap.SimpleEntry<String, Collection<KeyStore>> getKeystoresForReading( String alias) { String[] splits = alias.split(this.entryNameSeparatorRegEx, 2); if (splits.length == 2) { // prefixed alias KeyStore keystore = keystores.get(splits[0]); if (keystore != null) { return new AbstractMap.SimpleEntry<>( splits[1], (Collection<KeyStore>) Collections.singleton(keystore)); } } else if (splits.length == 1) { // unprefixed alias // Check all keystores for the first occurrence of the alias return new AbstractMap.SimpleEntry<>(alias, keystores.values()); } return new AbstractMap.SimpleEntry<>( "", (Collection<KeyStore>) Collections.<KeyStore>emptyList()); }