The class attached contains test code that works Ok under JDK 1.4 but
has never worked under 1.5. The scenario is where the secret key is to
be included with the message and encrypted using a public key then
decrypted by the recipient using their private key. When the key is
decrypted an instan
Sorry, I forgot the error produced in JDK 1.5
Original Exception was java.security.InvalidKeyException: Wrong
algorithm: DESede or TripleDES required
at
org.apache.xml.security.encryption.XMLCipher.decryptToByteArray(Unknown
Source)
at
org.apache.xml.security.encryption.XMLCipher.decry
Problem seems to be in this line:
final SecretKey unwrappedKey = (SecretKey)cipher.decryptKey(encryptedKey,
XMLCipher.RSA_v1dot5);
The second parameter to decryptKey method needs to be the symmetric key
algorithm.
Vishal
Peter Hendry wrote:
Sorry, I forgot the error produced in JDK 1.5
O
Thanks for the response. Changing to
final SecretKey unwrappedKey =
(SecretKey)cipher.decryptKey(encryptedKey, XMLCipher.TRIPLEDES);
does make it work! This leads onto the issue of how the receiver knows the symmetric key algorithm? This information is not transmitted in the EncryptedKey.