Archive

Posts Tagged ‘keytool’

Copying Keystore files across computers corrupting the keystore file

March 1st, 2011

I had a java project in my ubuntu netbeans, that used a keystore file created using keytool for secured communication with the server. When i deployed the project into a windows server it didnt work. When I tracred i was getting this exception

java.io.IOException: Keysize too big

Some times googling just doesnt work. I know only sometimes, most times it helps. I thought, it could be some JVM memory issue, then thought Windows OS issue. Finally decided to list the keystore using keytool in the server itself. I got the error,

keytool: java.io.IOException: Keysize too big

Now came to a conclusion its the keystore file is corrupted. WIth some help from IRC and stack over flow narrowed the problem. It was the way i copied the file to the server, i had used normal TEXT MODE FTP, which will mess the keystore file. As TEXT MODE copies line by line, few characters will be interpreted wrongly like ‘\n’. Using sftp, scp or binary mode is best. I used scp and it worked. I couldnt just accept i had been spending hours to trace the issue. Let me call it a day.. cheers.

A Nice reasoning in stackoverflow for my post: FTP programs try to convert between different line-ending modes, so one 10 byte on the unix side gets converted to one 10 and one 13 byte on the windows side – by Pa?lo Ebermann

http://stackoverflow.com/questions/5142396/java-io-ioexceptoin-keysize-too-big-in-windows-2003-server

Java, Programming, Ubuntu ,