A configuração da criptografia Java falha com InvalidKeySpecException

Eu estou tentando escrever um aplicativo simples que leva em arquivos enviados e criptografá-los antes de armazená-los em disco.

aqui está um trecho

InputStream is = item.openStream(); // item is obtained from file upload iterator
try{
   PBEKeySpec keySpec = new PBEKeySpec(passphrase.toCharArray(), salt.getBytes(),  iterations, keyLength);
   SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DESede"); 
   SecretKey key = keyFactory.generateSecret(keySpec); // Throws Exception
   CipherInputStream cis;
   Cipher cipher = Cipher.getInstance("RSA");
   cis = new CipherInputStream(is, cipher);
   cipher.init(Cipher.ENCRYPT_MODE, key);
 } catch (Exception ex){
    // catches the following exceptopn 
    java.security.spec.InvalidKeySpecException: Inappropriate key specification
    at com.sun.crypto.provider.DESedeKeyFactory.engineGenerateSecret(DashoA13*..)
   //
 }

Eu também tentei "RSA / ECB / PKCS1Padding" sem sucesso. O que eu fiz errado?

questionAnswers(1)

yourAnswerToTheQuestion