• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java BasicPasswordEncryptor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



BasicPasswordEncryptor类属于org.jasypt.util.password包,在下文中一共展示了BasicPasswordEncryptor类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: compareSimple2EncryptedPassword

import org.jasypt.util.password.BasicPasswordEncryptor; //导入依赖的package包/类
public static boolean compareSimple2EncryptedPassword(String plainPassword, String encryptedPassword) {
    if (plainPassword == null || encryptedPassword == null) {
        return false;
    }
    if (plainPassword.trim().length() == 0 || encryptedPassword.trim().length() == 0) {
        return false;
    }
    BasicPasswordEncryptor encryptor = new BasicPasswordEncryptor();
    return encryptor.checkPassword(plainPassword, encryptedPassword);
}
 
开发者ID:glycoinfo,项目名称:eurocarbdb,代码行数:11,代码来源:ChangePassword.java


示例4: getPasswordEncryptor

import org.jasypt.util.password.BasicPasswordEncryptor; //导入依赖的package包/类
public PasswordEncryptor getPasswordEncryptor() {
    switch (this) {
        case NONE : return null;
        case BASIC : return new BasicPasswordEncryptor();
        case STRONG : return new StrongPasswordEncryptor();
        default : throw new IllegalStateException("No support for encryptor type " + this);
    }
}
 
开发者ID:washingtonpost,项目名称:dropwizard-peer-authenticator,代码行数:9,代码来源:AllowedPeerConfiguration.java


示例5: checkLogin

import org.jasypt.util.password.BasicPasswordEncryptor; //导入依赖的package包/类
@Override
public boolean checkLogin(String email, String password) {
	BasicPasswordEncryptor passwordEncryptor = new BasicPasswordEncryptor();
	List l = userDAO.findByEmail(email);
	if (l == null || l.size() == 0) {
		return false;
	}
	User user = (User) userDAO.findByEmail(email).get(0);
	if (passwordEncryptor.checkPassword(password, user.getPassword())) {
		return true;
	}
	return false;
}
 
开发者ID:cloudzfy,项目名称:atmars,代码行数:14,代码来源:UserServiceImpl.java


示例6: 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


示例7: AuthenticUserWithTicket

import org.jasypt.util.password.BasicPasswordEncryptor; //导入依赖的package包/类
@Override
public boolean AuthenticUserWithTicket(int userId, String ticket) {
	User u = userDAO.findById(userId);
	String plainPassword = u.getEmail()+u.getNickname()+u.getTime().getTime();
	BasicPasswordEncryptor passwordEncryptor = new BasicPasswordEncryptor();
	return passwordEncryptor.checkPassword(plainPassword, ticket);
}
 
开发者ID:cloudzfy,项目名称:atmars,代码行数:8,代码来源:UserServiceImpl.java


示例8: checkLink

import org.jasypt.util.password.BasicPasswordEncryptor; //导入依赖的package包/类
public boolean checkLink(String email, String nickname, Date date, String encrypted) throws UnsupportedEncodingException {
	
	String plain = email + nickname + date.getTime();
	
	BasicPasswordEncryptor passwordEncryptor = new BasicPasswordEncryptor();
	if(!passwordEncryptor.checkPassword(plain, encrypted))
	{
		return false;
	}
	Date now = new Date();
	if(now.getTime() - now.getTime() > 86400000)
	{
		return false;
	}
	final String subject = "Your New Account in AtMars Microblog has been Activated";
	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>Congratulations to you! Your email account " + email + " is activated. Thank you for registering AtMars MicroBlog.</p><p>Try to use AtMars to follow your friends:</p><p>&nbsp;&nbsp;&nbsp;&nbsp;<a href='" + serverURL + "'>" + serverURL + "</a></p><p>We are glad to meet you in AtMars MicroBlog.</p></div></div>";
	final String to = email;
	
	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 true;
}
 
开发者ID:cloudzfy,项目名称:atmars,代码行数:35,代码来源:Jmail.java


示例9: DefaultSecurityHelper

import org.jasypt.util.password.BasicPasswordEncryptor; //导入依赖的package包/类
public DefaultSecurityHelper() {
    passwordEncryptor = new BasicPasswordEncryptor();
}
 
开发者ID:SECQME,项目名称:watchoverme-server,代码行数:4,代码来源:DefaultSecurityHelper.java


示例10: 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


示例11: matchPassword

import org.jasypt.util.password.BasicPasswordEncryptor; //导入依赖的package包/类
private boolean matchPassword(String password) {
    PasswordEncryptor pe = new BasicPasswordEncryptor();
    return pe.checkPassword(password, encryptedPassword);
}
 
开发者ID:OptimalBI,项目名称:optimal-spyglass-open-source,代码行数:5,代码来源:Main.java


示例12: authenticate

import org.jasypt.util.password.BasicPasswordEncryptor; //导入依赖的package包/类
public boolean authenticate(String unencryptedPassword) {
    return (new BasicPasswordEncryptor()).checkPassword(unencryptedPassword, password);
}
 
开发者ID:hohonuuli,项目名称:vars,代码行数:4,代码来源:UserAccountImpl.java


示例13: setPassword

import org.jasypt.util.password.BasicPasswordEncryptor; //导入依赖的package包/类
public void setPassword(String unencryptedPassword) {
    this.password = (new BasicPasswordEncryptor()).encryptPassword(unencryptedPassword);
}
 
开发者ID:hohonuuli,项目名称:vars,代码行数:4,代码来源:UserAccountImpl.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Map类代码示例发布时间:2022-05-22
下一篇:
Java InstrumentationTestSuite类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap