Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

How can I export private key from gateway.jks

avatar

I would like to get the private key from gateway.jks and tried the following command on my test cluster:

keytool -importkeystore -srckeystore ./gateway.jks -destkeystore gateway.jks -srcstoretype JKS -deststoretype PKCS12 -srcstorepass hadoop -srckeypass hadoop -deststorepass changeit -destkeypass changeit

Then getting error:

keytool error: java.io.IOException: DerInputStream.getLength(): lengthTag=109, too big.

Does anyone know how to fix/workaround above error?

1 ACCEPTED SOLUTION

avatar

The destination and source keystore are the same file: gateway.jks

Change the filename of -destkeystore gateway.jks maybe -destkeystore gateway.p12?

You'll also need to specify the alias: -alias gateway-identity

View solution in original post

3 REPLIES 3

avatar

The destination and source keystore are the same file: gateway.jks

Change the filename of -destkeystore gateway.jks maybe -destkeystore gateway.p12?

You'll also need to specify the alias: -alias gateway-identity

avatar

yes, it was my stupid typo. Thanks!

avatar
@Hajime

Seems like your keystore file is not valid. Are you able to do -list operation on that file? if the keystore file is not sensitive you can attach it here, can validate the file