Re: Error While importing certificate into keystore

2022-06-28 Thread Christopher Schultz

Mohan,

On 6/28/22 09:54, Mohan T wrote:
I am trying top import the certificate into keystore and encountered the 
below error.


Would appreciate if you could throw some light on this

$ keytool -importkeystore -srckeystore /home/ilas/Downloads/okta.cert 
-srcstoretype pkcs12 -destkeystore /home/ilas/Downloads/keystore.jks 
-deststoretype JKS


Importing keystore /home/ilas/Downloads/okta.cert to 
/home/ilas/Downloads/keystore.jks...


Enter destination keystore password:

Enter source keystore password:

keytool error: java.io.IOException: toDerInputStream rejects tag type 45


Open your okta.cert file in notepad/less or similar. Does it look like this?

-BEGIN CERTIFICATE-
[stuff]
-END CERTIFICATE-

If so, then you want to do this:

$ keytool -importcert -keystore /home/ilas/Downloads/keystore.jks -alias 
'Okta 2022' < /home/ilas/Downloads/okta.cert


The cert may be in DER format which is just the same format but not 
using base64-encoding with the -BEGIN and -END wrapper around 
it. keytool can read that type of cert as well using the command above.


If you aren't super comfortable with keystores, PEM and/or DER files, 
etc. then I would suggest that you use a tool that can help you manage 
these things that will help you avoid mistakes such as Keystore Explorer:

https://keystore-explorer.org/

-chris

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



AW: Error While importing certificate into keystore

2022-06-28 Thread Thomas Hoffmann (Speed4Trade GmbH)
Hello Mohan,

keytool is not part of Tomcat.

The attachment didn't survive but maybe the certificate has the wrong format.
You can also try some tools which will convert certificates automatically, e.g.
https://github.com/kaikramer/keystore-explorer
Also note, that for SSL to work, you need both, private and public key, within 
the keystore for the server / tomcat.

Greetings, Thomas

Von: Mohan T 
Gesendet: Dienstag, 28. Juni 2022 15:54
An: Tomcat Users List 
Betreff: Error While importing certificate into keystore

Dear All.

I am trying top import the certificate into keystore and encountered the below 
error.

Would appreciate if you could throw some light on this

$ keytool -importkeystore -srckeystore /home/ilas/Downloads/okta.cert 
-srcstoretype pkcs12 -destkeystore /home/ilas/Downloads/keystore.jks 
-deststoretype JKS
Importing keystore /home/ilas/Downloads/okta.cert to 
/home/ilas/Downloads/keystore.jks...
Enter destination keystore password:
Enter source keystore password:
keytool error: java.io.IOException: toDerInputStream rejects tag type 45

Attaching the  certificate for reference.

Thanks

Mohan
DISCLAIMER: This communication contains information which is confidential and 
the copyright of Ramco Systems Ltd, its subsidiaries or a third party 
("Ramco"). This email may also contain legally privileged information. 
Confidentiality and legal privilege attached to this communication are not 
waived or lost by reason of mistaken delivery to you.This email is intended to 
be read or used by the addressee only. If you are not the intended recipient, 
any use, distribution, disclosure or copying of this email is strictly 
prohibited without the express written approval of Ramco. Please delete and 
destroy all copies and email Ramco at le...@ramco.com<mailto:le...@ramco.com> 
immediately. Any views expressed in this communication are those of the 
individual sender, except where the sender specifically states them to be the 
views of Ramco. Except as required by law, Ramco does not represent, warrant 
and/or guarantee that the integrity of this communication has been maintained 
nor that the communication is free of errors, virus, interception or 
interference. If you do not wish to receive such communications, please forward 
this communication to market...@ramco.com<mailto:market...@ramco.com> and 
express your wish not to receive such communications henceforth.


Error While importing certificate into keystore

2022-06-28 Thread Mohan T
Dear All.

I am trying top import the certificate into keystore and encountered the below 
error.

Would appreciate if you could throw some light on this

$ keytool -importkeystore -srckeystore /home/ilas/Downloads/okta.cert 
-srcstoretype pkcs12 -destkeystore /home/ilas/Downloads/keystore.jks 
-deststoretype JKS
Importing keystore /home/ilas/Downloads/okta.cert to 
/home/ilas/Downloads/keystore.jks...
Enter destination keystore password:
Enter source keystore password:
keytool error: java.io.IOException: toDerInputStream rejects tag type 45

Attaching the  certificate for reference.

Thanks

Mohan
DISCLAIMER: This communication contains information which is confidential and 
the copyright of Ramco Systems Ltd, its subsidiaries or a third party 
("Ramco"). This email may also contain legally privileged information. 
Confidentiality and legal privilege attached to this communication are not 
waived or lost by reason of mistaken delivery to you.This email is intended to 
be read or used by the addressee only. If you are not the intended recipient, 
any use, distribution, disclosure or copying of this email is strictly 
prohibited without the express written approval of Ramco. Please delete and 
destroy all copies and email Ramco at le...@ramco.com immediately. Any views 
expressed in this communication are those of the individual sender, except 
where the sender specifically states them to be the views of Ramco. Except as 
required by law, Ramco does not represent, warrant and/or guarantee that the 
integrity of this communication has been maintained nor that the communication 
is free of errors, virus, interception or interference. If you do not wish to 
receive such communications, please forward this communication to 
market...@ramco.com and express your wish not to receive such communications 
henceforth.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org