The following class file represents a beginning attempt to develop a service to encrypt a password. This file cannot locate the import -- java.security.MessageDigest -- which I believe is incorporated as part of the currently installed jre6. I presume it is a configuration issue on my end -- possibly having to do with security policy. Can you provide a distilled example of how to config GWTDesigner to utilize java.security.*?
ERROR: In the following CODE, MessageDigest is flagged with this error --
java.security.MessageDigest can not be found in source packages. Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly.
CODE SNIPPET:
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public final class PasswordService
{
public PasswordService()
{
}
public byte[] encrypt(String x) throws Exception {
MessageDigest d = null;
d = MessageDigest.getInstance("SHA-1");
d.reset();
d.update(x.getBytes());
return d.digest();
}
}