Dear Martin,
The public key I extract from CPA is in X509 format. But I can import
into .keystore but I can't really restart tomcat as it has exception
error on Invalid Keystore Format. I tried to import using command
line keytool but always get io.EOFException error and when I use
Keytool GUI, I can import. but got error as mention above.
Now, the question is back to what format can tomcat understand?
probably any format that keytool generate. But why my tomcat is
getting errors and not starting. converting to x509 is my desperate
attempt which might not solve my problem.
my tomcat version is 5.5 and my jdk is 1.5.0_15 if that is of any
relevant.
convus.modlue.xml contain
<component id="ssl-trust-manager" name="SSL Trust Manager">
<class>hk.hku.cecid.piazza.commons.security.KeyStoreTrustManager</
class>
<parameter name="keystore-location" value="c:\certs" />
<parameter name="keystore-password" value="changeit" />
</component>
and my .keystore file is in c:\certs
and yes. I am still using default .keystore just importing public key
using keytool GUI.
convus.properties.xml contain
<environment>
<properties>
<http.proxyHost/>
<http.proxyPort/>
<https.proxyHost/>
<https.proxyPort/>
<sun.net.client.defaultConnectTimeout>30000</
sun.net.client.defaultConnectTimeout>
<sun.net.client.defaultReadTimeout>300000</
sun.net.client.defaultReadTimeout>
<!--javax.net.ssl.trustStore>/jdk1.5.0_15/jre/lib/security/cacerts</
javax.net.ssl.trustStore-->
<!-- javax.net.ssl.trustStore>/j2sdk1.4.2_04/jre/lib/security/
cacerts</javax.net.ssl.trustStore -->
<!-- javax.net.ssl.trustStorePassword>password</
javax.net.ssl.trustStorePassword -->
<file.encoding>UTF-8</file.encoding>
</properties>
</environment>
not sure if those above are of any relevant. any suggesetion?
Regards,
Ye
On Mar 9, 4:54 pm, Martin Kalén <
martin.ka...@gmail.com> wrote:
> On 9 Mar, 09:09, Ye <
MrYe...@gmail.com> wrote:
>
> > so, my question now is... what format does it need to be for .keystore
> > file? And if i need X.509 format, is there any tool that can
> > convert? keytool GUI I have (v. 1.7) doesn't have X.509 format.
>
> The default Java runtime keystore format, if you use a Sun JRE, is a
> proprietary format called JKS and defined by Sun. Normally you don't
> need knowledge about the format if you use keytool to manage the
> certificates in keystore.
>
> X.509 is a complete PKI standard and does not specify a single
> certificate format. There are several possible formats. Read a bit
> more on e.g. Wikipedia:
http://en.wikipedia.org/wiki/X.509
>
> I would listen to T. Kirschner's advice and use OpenSSL for
> conversion. If you have a public certficate in PEM-format (Base64-
> encoded DER certificate, ASCII readable) you can convert it to DER
> (binary format) with:
> openssl x509 -in [your_public_cert.pem] -out new_public_cert.der -
> outform DER
>
> After this, use keytool to import:
> keytool -import -alias [your_certificate_alias] -file
> new_public_cert.der -keystore [your_jks_keystore] -storepass
> [your_jks_keystore_password]
>
> Read more about Sun's keytool athttp://
java.sun.com/j2se/1.5.0/docs/tooldocs/#security