aspose file tools*
The moose likes Security and the fly likes NoSuchAlgorithm for KeyGenerator.getInstance( Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Security
Bookmark "NoSuchAlgorithm for KeyGenerator.getInstance("HmacMD5")" Watch "NoSuchAlgorithm for KeyGenerator.getInstance("HmacMD5")" New topic
Author

NoSuchAlgorithm for KeyGenerator.getInstance("HmacMD5")

Jeff Breeden
Greenhorn

Joined: Jan 23, 2013
Posts: 2
In a Spring MVC web app, I'm getting a NoSuchAlgorithmException from both Eclipse and Maven on



The javax.crypto packages are imported (the KeyGenerator object is recognized) so if I'm reading correctly, it is not finding MD5 in any available provider.
In the project properties it has jce.jar in the build path in the jre6\lib folder. Is there any other file or path I should check? Do I need something in my project folder?

Richard Tookey
Ranch Hand

Joined: Aug 27, 2012
Posts: 1067
    
  10

HmacMD5 works for me in 1.7 and has worked in all SunJCE providers I can remember for the last 10 years or so. Are you sure the NoSuchAlgorithmException is coming from that line?

The program I use for checking which provider provides which algorithms is -
Jeff Breeden
Greenhorn

Joined: Jan 23, 2013
Posts: 2
I was mis-reading it. I needed "throws NoSuchAlgorithmException" on the method definition. Thank you for the response.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NoSuchAlgorithm for KeyGenerator.getInstance("HmacMD5")