Hi
IDM:4.5

Message: Code(-9131) Error in
vnd.nds.stream://IDV-TEST/system/DriverSet/ldap1-LDAP/Subscriber/NOVLLDAPENT-sub-ctp-EntitlementsImpl#XmlData:99
: Error evaluating XPATH expression
'token-xpath("pwden:getMD5u($password')
")' : com.novell.xml.xpath.XPathEvaluationException: function
'pwden:getMD5u' not found.

code:
package com.md5;

import java.security.MessageDigest;

public class getMD5 {

public static String getMD5u(String message) {
MessageDigest messageDigest = null;
StringBuffer md5StrBuff = new StringBuffer();
try {
messageDigest = MessageDigest.getInstance("MD5");
messageDigest.reset();
messageDigest.update(message.getBytes("UTF-8"));

byte[] byteArray = messageDigest.digest();
for (int i = 0; i < byteArray.length; i++)
{
if (Integer.toHexString(0xFF & byteArray[i]).length() == 1)
md5StrBuff.append("0").append(Integer.toHexString( 0xFF & byteArray[i]));
else
md5StrBuff.append(Integer.toHexString(0xFF & byteArray[i]));
}
} catch (Exception e) {
throw new RuntimeException();
}
return md5StrBuff.toString().toUpperCase();//字母大写
}
public static String getMD5l(String message) {
MessageDigest messageDigest = null;
StringBuffer md5StrBuff = new StringBuffer();
try {
messageDigest = MessageDigest.getInstance("MD5");
messageDigest.reset();
messageDigest.update(message.getBytes("UTF-8"));

byte[] byteArray = messageDigest.digest();
for (int i = 0; i < byteArray.length; i++)
{
if (Integer.toHexString(0xFF & byteArray[i]).length() == 1)
md5StrBuff.append("0").append(Integer.toHexString( 0xFF & byteArray[i]));
else
md5StrBuff.append(Integer.toHexString(0xFF & byteArray[i]));
}
} catch (Exception e) {
throw new RuntimeException();
}
return md5StrBuff.toString();
}
}



policy:
policy xmlnswden="http://www.novell.com/nxsl/java/com.md5.getMD5"
token xpath:
token-xpath expression="pwden:getMD5u($password)"/


please support.