MD5PasswordEncoder.java
1006 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package weaver.authentication.handler.encoder;
import org.jasig.cas.authentication.handler.PasswordEncoder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import weaver.loginsso.AES;
import java.util.Map;
/**
* Created by crazyDream on 2018/9/17.
*/
public class MD5PasswordEncoder implements PasswordEncoder {
@Override
public String encode(String password) {
return null;
}
@Override
public String encode(String username, String password) {
/*try {
String yjcust = AES.decrypt(password, "yjcust");
if (yjcust != null && yjcust.indexOf("-f-g-") > 0) {
password=yjcust.substring(0,yjcust.indexOf("-f-g-"));
}
} catch (Exception e) {
e.printStackTrace();
}*/
MD5 md5 = new MD5();
return md5.getMD5ofStr(password);
}
@Override
public String encode(String username, String password, Map<String, Object> otherParams) {
return null;
}
}