Discussion:
How to perform keytool operation using Java code
Raghav
2017-07-11 13:20:59 UTC
Permalink
Hi

I followed https://kafka.apache.org/documentation/#security to create
keystore and trust store using Java Keytool. Now, I am looking to do the
same stuff programmatically using Java. I am struggling to find the right
Java classes to perform following operations:

1. How to extract CSR from a keystore using Java classes ?

2. How to add a CA cert to a keystore using Java classes ?

I tried to following
http://docs.oracle.com/javase/6/docs/api/java/security/KeyStore.html#load%28java.io.InputStream,%20char%5B%5D%29
but
could not get answers.

Any help here is greatly appreciated.

Thanks.
--
Raghav
Raghav
2017-07-12 21:23:06 UTC
Permalink
Guys, Would anyone know about it ?
Post by Raghav
Hi
I followed https://kafka.apache.org/documentation/#security to create
keystore and trust store using Java Keytool. Now, I am looking to do the
same stuff programmatically using Java. I am struggling to find the right
1. How to extract CSR from a keystore using Java classes ?
2. How to add a CA cert to a keystore using Java classes ?
I tried to following http://docs.oracle.com/javase/6/docs/api/java/
security/KeyStore.html#load%28java.io.InputStream,%20char%5B%5D%29 but
could not get answers.
Any help here is greatly appreciated.
Thanks.
--
Raghav
--
Raghav
Rajini Sivaram
2017-07-13 09:41:06 UTC
Permalink
Hi Raghav,

You could take a look at
https://github.com/apache/kafka/blob/trunk/clients/src/test/java/org/apache/kafka/test/TestSslUtils.java

Regards,

Rajini
Post by Raghav
Guys, Would anyone know about it ?
Post by Raghav
Hi
I followed https://kafka.apache.org/documentation/#security to create
keystore and trust store using Java Keytool. Now, I am looking to do the
same stuff programmatically using Java. I am struggling to find the right
1. How to extract CSR from a keystore using Java classes ?
2. How to add a CA cert to a keystore using Java classes ?
I tried to following http://docs.oracle.com/javase/6/docs/api/java/secu
rity/KeyStore.html#load%28java.io.InputStream,%20char%5B%5D%29 but could
not get answers.
Any help here is greatly appreciated.
Thanks.
--
Raghav
--
Raghav
Raghav
2017-07-13 13:57:31 UTC
Permalink
Thanks.
Post by Rajini Sivaram
Hi Raghav,
You could take a look at https://github.com/apache/
kafka/blob/trunk/clients/src/test/java/org/apache/kafka/
test/TestSslUtils.java
Regards,
Rajini
Post by Raghav
Guys, Would anyone know about it ?
Post by Raghav
Hi
I followed https://kafka.apache.org/documentation/#security to create
keystore and trust store using Java Keytool. Now, I am looking to do the
same stuff programmatically using Java. I am struggling to find the right
1. How to extract CSR from a keystore using Java classes ?
2. How to add a CA cert to a keystore using Java classes ?
I tried to following http://docs.oracle.com/javase/6/docs/api/java/secu
rity/KeyStore.html#load%28java.io.InputStream,%20char%5B%5D%29 but
could not get answers.
Any help here is greatly appreciated.
Thanks.
--
Raghav
--
Raghav
--
Raghav
Loading...