problem when decrypting (is this a bug)

Hi

Actually I resolved my problem but I wanted to know if this is a bug, report it to Sun, and also I want if someone encounters this problem, may be this thread help her/him

I create a JKS file (keystore file) using keytool

keytool -genkey -keyalg RSA -alias myalias -keypass kpass -storepass spass -keysize 1024 -keystore keystorefile.jks -validity 365

and then I want to export this keystore to a cert file

keytool -storepass spass -alias myalias -export -keystore keystorefile.jks -file certfile.cer

but when I decrypt using this keystore I get following error

Keystore was tampered with, or password was incorrect

so after a toiling I understand I should remove -keypass and -storepass options from the command line and let the program ask for them. so the problem has gone

do you think it is a bug? or somewhere I made mistake?

[894 byte] By [java1357a] at [2007-11-27 5:54:24]
# 1

> but when I decrypt using this keystore I get

> following error

> > Keystore was tampered with, or password was

> incorrect

>

How are you accessing the keystore?

> so after a toiling I understand I should remove

> -keypass and -storepass options from the command line

> and let the program ask for them. so the problem has

> gone

You should not need to do this.

>

> do you think it is a bug? or somewhere I made mistake?

Almost certainly a bug in YOUR code but since we can't see it ...

sabre150a at 2007-7-12 15:48:52 > top of Java-index,Security,Cryptography...
# 2

no I am using Apache Xml Security, and I have no code written by myself.

I tried it more than ten times but every time it failed, untill I remove those options from keytool

I took a search on internet and It seems a bug in jdk I am not sure.

now with this latest keystore Apache Xml security works fine. but with those option not

java1357a at 2007-7-12 15:48:52 > top of Java-index,Security,Cryptography...
# 3
you ask how I access it, I just introduce the file name to Apache XML Security,
java1357a at 2007-7-12 15:48:52 > top of Java-index,Security,Cryptography...
# 4
I use 'keytool' and class KeyStore using a 'store' passphrase and a 'key' passphrase. I have no problems so if you are having a problem then it is probably something in the way you use Apache XML or in Apache XML. Ask on the Apache XML site.
sabre150a at 2007-7-12 15:48:52 > top of Java-index,Security,Cryptography...