当前位置: 首页>>代码示例>>Java>>正文


Java BasicPasswordEncryptor.encryptPassword方法代码示例

本文整理汇总了Java中org.jasypt.util.password.BasicPasswordEncryptor.encryptPassword方法的典型用法代码示例。如果您正苦于以下问题:Java BasicPasswordEncryptor.encryptPassword方法的具体用法?Java BasicPasswordEncryptor.encryptPassword怎么用?Java BasicPasswordEncryptor.encryptPassword使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jasypt.util.password.BasicPasswordEncryptor的用法示例。


在下文中一共展示了BasicPasswordEncryptor.encryptPassword方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: register

import org.jasypt.util.password.BasicPasswordEncryptor; //导入方法依赖的package包/类
@Override
public void register(String email, String password, String nickname,
		boolean gender) {
	BasicPasswordEncryptor passwordEncryptor = new BasicPasswordEncryptor();
	String encryptedPassword = passwordEncryptor.encryptPassword(password);
	User user = new User();
	user.setEmail(email);
	user.setPassword(encryptedPassword);
	user.setNickname(nickname);
	user.setGender(gender);

	user.setFollowerCount(0);
	user.setFollowingCount(0);
	user.setPostCount(0);
	user.setTime(new Date());

	userDAO.save(user);
}
 
开发者ID:cloudzfy,项目名称:atmars,代码行数:19,代码来源:UserServiceImpl.java

示例2: sendEmail

import org.jasypt.util.password.BasicPasswordEncryptor; //导入方法依赖的package包/类
public String sendEmail(String email, String nickname, Date date) throws UnsupportedEncodingException {
	
	String plain = email + nickname + date.getTime();
	BasicPasswordEncryptor passwordEncryptor = new BasicPasswordEncryptor();
	String encrypted = passwordEncryptor.encryptPassword(plain);
	String urlEncodedString = java.net.URLEncoder.encode(encrypted, "UTF-8");
	final String to = email;
	final String subject = "AtMars Microblog New User Register Comfirmation Email";
	final String content = "<div style='width:713px; background-color:#A1E0E9; padding-top:30px; padding-bottom:30px; margin: 0 auto;'><img src='" + serverURL + logo_img + "' width='160' /><img src='" + serverURL + poster_img + "' width='100%' /><div style='background-color:#FFFFFF; border-radius:3px; box-shadow:0 1px 3px rgba(0,0,0,0.25); border:1px solid #CCC; padding:20px 20px 20px 20px; margin-left:30px; margin-right:30px; margin-top:30px;'><p><b>Welcome to AtMars MicroBlog</b></p><p>Thank you for registering AtMars MicroBlog.</p><p>To comfirm the email address you provided during registration. please click the following link in 24 hours:</p><p><a href='" + serverURL + "checkEmail?email=" + email + "&ticket=" + urlEncodedString + "'>" + serverURL + "checkEmail?email=" + email + "&ticket=" + urlEncodedString + "</a></p><p>If this link does not work, copy and paste the link into your browser.</p></div></div>";
	
	jmsTemplate.send(destination, new MessageCreator() {

		@Override
		public Message createMessage(Session session) throws JMSException {
			MapMessage message = session.createMapMessage();
			
			message.setString("To", to);
			message.setString("Subject", subject);
			message.setString("Content", content);
			
			return message;
		}
		
	});
	return encrypted;
}
 
开发者ID:cloudzfy,项目名称:atmars,代码行数:27,代码来源:Jmail.java

示例3: CalculateTicket

import org.jasypt.util.password.BasicPasswordEncryptor; //导入方法依赖的package包/类
@Override
public String CalculateTicket(User user) throws UnsupportedEncodingException {
	String plain = user.getEmail()+user.getNickname()+user.getTime().getTime();
	BasicPasswordEncryptor passwordEncryptor = new BasicPasswordEncryptor();
	String encrypted = passwordEncryptor.encryptPassword(plain);
	String urlEncodedString = java.net.URLEncoder.encode(encrypted, "UTF-8");
	return urlEncodedString;
}
 
开发者ID:cloudzfy,项目名称:atmars,代码行数:9,代码来源:UserServiceImpl.java

示例4: getBasicEncryptedPassword

import org.jasypt.util.password.BasicPasswordEncryptor; //导入方法依赖的package包/类
public static String getBasicEncryptedPassword(String textPassword) {
    BasicPasswordEncryptor encryptor = new BasicPasswordEncryptor();
    return encryptor.encryptPassword(textPassword);
}
 
开发者ID:glycoinfo,项目名称:eurocarbdb,代码行数:5,代码来源:ChangePassword.java


注:本文中的org.jasypt.util.password.BasicPasswordEncryptor.encryptPassword方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。