It don't work with "PBEWithHmacSHA1AndDESede". What wrong?  
Author Message
John





PostPosted: 2004-9-12 5:56:00 Top

java-programmer, It don't work with "PBEWithHmacSHA1AndDESede". What wrong? Hi.

In the following source, I got the exception :

"java.security.NoSuchAlgorithmException:
Cannot find any provider supporting PBEWithHmacSHA1AndDESede"


<source>

Cipher cipher;
SecretKey secretKey;
PBEParameterSpec parameterSpec;

try {

PBEKeySpec keySpec = new PBEKeySpec(password.toCharArray());

cipher = Cipher.getInstance("PBEWithHmacSHA1AndDESede");

SecretKeyFactory secKeyFac = SecretKeyFactory
.getInstance("PBEWithMD5AndDES");

secretKey = secKeyFac.generateSecret(keySpec);

parameterSpec = new PBEParameterSpec(salt, iteration);

} catch (NoSuchAlgorithmException e) {
} catch (NoSuchPaddingException e) {
} catch (InvalidKeySpecException e) {
}

</source>


The source above work with "PBEWithMD5AndDES". But, not
with "PBEWithHmacSHA1AndDESede". In the Sun's JCE API
Reference Guide, the "PBEWithHmacSHA1AndDESede" is the
standard name ( I use JDK 1.5 RC ).

What wrong? Thank you for your help.