??????????????????????????
??????????com.opensymphony.user.provider.hibernate.impl
????HibernateUserImpl.java ????????????? ???????????
public boolean authenticate(String password)
{
if ((password == null) || (getPasswordHash() == null) || (password.length() == 0)) {
return false;
}
return compareHash(getPasswordHash()?? password);
}
public void removeGroup(HibernateGroup group)
{
if ((this.groups != null) && (this.groups.contains(group)))
this.groups.remove(group);
}
private boolean compareHash(String hashedValue?? String unhashedValue)
{
return hashedValue.equals(createHash(unhashedValue));
}
private String createHash(String original) {
byte[] digested = PasswordDigester.digest(original.getBytes());
byte[] encoded = Base64.encode(digested);
return new String(encoded);
}
????-- ?????????????????????????? MyEclipse ???????? java ????????? Base64.java ?? PassworDigester.java
????????? Test.java ?? д??????????? createHash() ????????????
????// ??????????????? UserUtils ?????????? atlassian-jira/WEB-INF/lib/atlassian-core-4.5.2.jar
????com.atlassian.core.user ???檔