Java Code Examples for org.springframework.security.authentication.encoding.Md5PasswordEncoder#setEncodeHashAsBase64()

The following examples show how to use org.springframework.security.authentication.encoding.Md5PasswordEncoder#setEncodeHashAsBase64() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MD5Test.java    From paascloud-master with Apache License 2.0 5 votes vote down vote up
/**
 * Md 5 system wide salt source.
 */
private static void md5_SystemWideSaltSource() {
	Md5PasswordEncoder md5 = new Md5PasswordEncoder();
	md5.setEncodeHashAsBase64(false);

	// 使用动态加密盐的只需要在注册用户的时候将第二个参数换成用户名即可     
	String pwd = md5.encodePassword("123456", "acegisalt");
	log.info("MD5 SystemWideSaltSource: " + pwd + " len=" + pwd.length());
}
 
Example 2
Source File: AppSecurityModelG.java    From Spring-5.0-Cookbook with MIT License 5 votes vote down vote up
@Bean
public Md5PasswordEncoder md5PasswordEncoder(){
 Md5PasswordEncoder md5 = new Md5PasswordEncoder();
 md5.setEncodeHashAsBase64(true);
 md5.setIterations(32);
 return md5;
}
 
Example 3
Source File: AppSecurityModelE2.java    From Spring-5.0-Cookbook with MIT License 5 votes vote down vote up
@Bean
public Md5PasswordEncoder md5PasswordEncoder(){
 Md5PasswordEncoder md5 = new Md5PasswordEncoder();
 md5.setEncodeHashAsBase64(true);
 md5.setIterations(32);
 return md5;
}
 
Example 4
Source File: AppPasswordEncoder.java    From Spring-5.0-Cookbook with MIT License 5 votes vote down vote up
public String md5Encoder(String password, String salt) {
    Md5PasswordEncoder md5PasswordEncoder = new Md5PasswordEncoder();
    md5PasswordEncoder.setEncodeHashAsBase64(true);
    md5PasswordEncoder.setIterations(32);
    String encoded = md5PasswordEncoder.encodePassword(password,salt);
    return encoded;     
}
 
Example 5
Source File: AppSecurityModelJ.java    From Spring-5.0-Cookbook with MIT License 5 votes vote down vote up
@Bean
public Md5PasswordEncoder md5PasswordEncoder(){
 Md5PasswordEncoder md5 = new Md5PasswordEncoder();
 md5.setEncodeHashAsBase64(true);
 md5.setIterations(32);
 return md5;
}
 
Example 6
Source File: AppSecurityModelE.java    From Spring-5.0-Cookbook with MIT License 5 votes vote down vote up
@Bean
public Md5PasswordEncoder md5PasswordEncoder(){
 Md5PasswordEncoder md5 = new Md5PasswordEncoder();
 md5.setEncodeHashAsBase64(true);
 md5.setIterations(32);
 return md5;
}
 
Example 7
Source File: AppSecurityModelF.java    From Spring-5.0-Cookbook with MIT License 5 votes vote down vote up
@Bean
public Md5PasswordEncoder md5PasswordEncoder(){
 Md5PasswordEncoder md5 = new Md5PasswordEncoder();
 md5.setEncodeHashAsBase64(true);
 md5.setIterations(32);
 return md5;
}
 
Example 8
Source File: AppSecurityModelG.java    From Spring-5.0-Cookbook with MIT License 5 votes vote down vote up
@Bean
public Md5PasswordEncoder md5PasswordEncoder(){
 Md5PasswordEncoder md5 = new Md5PasswordEncoder();
 md5.setEncodeHashAsBase64(true);
 md5.setIterations(32);
 return md5;
}
 
Example 9
Source File: AppSecurityModelE2.java    From Spring-5.0-Cookbook with MIT License 5 votes vote down vote up
@Bean
public Md5PasswordEncoder md5PasswordEncoder(){
 Md5PasswordEncoder md5 = new Md5PasswordEncoder();
 md5.setEncodeHashAsBase64(true);
 md5.setIterations(32);
 return md5;
}
 
Example 10
Source File: AppPasswordEncoder.java    From Spring-5.0-Cookbook with MIT License 5 votes vote down vote up
public String md5Encoder(String password, String salt) {
    Md5PasswordEncoder md5PasswordEncoder = new Md5PasswordEncoder();
    md5PasswordEncoder.setEncodeHashAsBase64(true);
    md5PasswordEncoder.setIterations(32);
    String encoded = md5PasswordEncoder.encodePassword(password,salt);
    return encoded;     
}
 
Example 11
Source File: AppSecurityModelJ.java    From Spring-5.0-Cookbook with MIT License 5 votes vote down vote up
@Bean
public Md5PasswordEncoder md5PasswordEncoder(){
 Md5PasswordEncoder md5 = new Md5PasswordEncoder();
 md5.setEncodeHashAsBase64(true);
 md5.setIterations(32);
 return md5;
}
 
Example 12
Source File: AppSecurityModelE.java    From Spring-5.0-Cookbook with MIT License 5 votes vote down vote up
@Bean
public Md5PasswordEncoder md5PasswordEncoder(){
 Md5PasswordEncoder md5 = new Md5PasswordEncoder();
 md5.setEncodeHashAsBase64(true);
 md5.setIterations(32);
 return md5;
}
 
Example 13
Source File: AppSecurityModelF.java    From Spring-5.0-Cookbook with MIT License 5 votes vote down vote up
@Bean
public Md5PasswordEncoder md5PasswordEncoder(){
 Md5PasswordEncoder md5 = new Md5PasswordEncoder();
 md5.setEncodeHashAsBase64(true);
 md5.setIterations(32);
 return md5;
}