Saturday, September 20, 2003 02:49 PM
Unfortunately, you cannot use KeyFactory with "DESede" algorithm as J2SE v1.4.x SDK supports KeyFactory only for "DSA", "RSA" and "DiffieHellman" algorithms.
The Javadoc documentation is not very clear on what algorithms are supported for a particular Cryptographic Service (KeyFactory is a cryptographic service). What is clear, though, based on method names and their semantics, is that it supports only public-private key cryptography. whereas, "DESede" is a secret key encryption algorithm.
You can use your own secret key by serialising the key, writing it into file and then later on, reading this file to populate the Key object. However, this method sufferes from a limitation: the serailized key can be used only by Java programs. If you want it to be language independent then you can store the encoded key, which you get by calling getEncoded() method.
Pankaj Kumar.Home WebLog J2EE Security