### Question:
KafkaClientKeystores { public KeyStore createKeystore(KeystoreConfig conf) throws IOException, CertificateException, NoSuchAlgorithmException, KeyStoreException { return this.createKeystore(conf.key(), conf.certificate(), conf.caChain()); } KafkaClientKeystores(String password); KeyStore createKeystore(KeystoreConfig conf); KeyStore createKeystore(InputStream privateKey, InputStream certificate,
                                 InputStream caChain); KeyStore createTruststore(KeystoreConfig conf); KeyStore createTruststore(X509Certificate certificate); static List<X509Certificate> readCertificateChain(CertificateFactory factory, InputStream is); byte[] writeStore(Optional<String> directory, String type, KeyStore store); static void main(String[] argv);  }### Answer:
@Test public void testKeystore() throws Exception { InputStream key = stream("client.key"); InputStream cert = stream("client.crt"); InputStream caChain = stream("ca_chain"); KafkaClientKeystores keystores = new KafkaClientKeystores(PASSWORD); KeyStore store = keystores.createKeystore(key, cert, caChain); verifyKeystore(store); }
@Test public void testKeystoreWithRSAKey() throws Exception { InputStream key = stream("client-rsa.key"); InputStream cert = stream("client.crt"); InputStream caChain = stream("ca_chain"); KafkaClientKeystores keystores = new KafkaClientKeystores(PASSWORD); KeyStore store = keystores.createKeystore(key, cert, caChain); verifyKeystore(store); }