static List<CertificateEntries> create(KeyStore keystore) throws GeneralSecurityException {
            Enumeration<String> aliases = keystore.aliases();
            List<CertificateEntries> entries = new ArrayList<>();
            while (aliases.hasMoreElements()) {
                String alias = aliases.nextElement();
                Certificate cert  = keystore.getCertificate(alias);
                if (cert instanceof X509Certificate)
                    entries.add(new CertificateEntries(alias, (X509Certificate) cert));
            }
            return entries;
        }
Copy entry from one map into another.

@param destMap   The map to copy entries into.
@param srcMap    The map to copy entries from.
@param key       The entry with this key will be copied
@param <K>       The map key type.
@param <V>       The map value type.
clients/src/main/java/org/apache/kafka/common/security/ssl/SslFactory.java