For Programmers: Free Programming Magazines  


Home > Archive > Java Security > September 2004 > It don't work with "PBEWithHmacSHA1AndDESede". What wrong?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

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

2004-09-11, 8:56 pm

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.



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com