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


Java DefaultPasswordService类代码示例

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


DefaultPasswordService类属于org.apache.shiro.authc.credential包,在下文中一共展示了DefaultPasswordService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: LegacyNexusPasswordService

import org.apache.shiro.authc.credential.DefaultPasswordService; //导入依赖的package包/类
public LegacyNexusPasswordService() {
  //Initialize and configure sha1 password service
  this.sha1PasswordService = new DefaultPasswordService();
  DefaultHashService sha1HashService = new DefaultHashService();
  sha1HashService.setHashAlgorithmName("SHA-1");
  sha1HashService.setHashIterations(1);
  sha1HashService.setGeneratePublicSalt(false);
  this.sha1PasswordService.setHashService(sha1HashService);
  this.sha1PasswordService.setHashFormat(new HexFormat());

  //Initialize and configure md5 password service
  this.md5PasswordService = new DefaultPasswordService();
  DefaultHashService md5HashService = new DefaultHashService();
  md5HashService.setHashAlgorithmName("MD5");
  md5HashService.setHashIterations(1);
  md5HashService.setGeneratePublicSalt(false);
  this.md5PasswordService.setHashService(md5HashService);
  this.md5PasswordService.setHashFormat(new HexFormat());
}
 
开发者ID:sonatype,项目名称:nexus-public,代码行数:20,代码来源:LegacyNexusPasswordService.java

示例2: resetPwd

import org.apache.shiro.authc.credential.DefaultPasswordService; //导入依赖的package包/类
@ResponseBody
@RequestMapping(value = "/reset")
@RequiresPermissions("user:reset")
//@SystemControllerLog(description="权限管理-添加用户")
public String resetPwd(int id) {
	try {
		User user = userService.find(id);
		user.setUserPass(new DefaultPasswordService().encryptPassword("123456"));
		userService.update(user);
		return "{ \"success\" : true }";
	} catch (Exception e) {
		e.printStackTrace();
		return "{ \"success\" : false, \"msg\" : \"操作失败\" }";
	}
}
 
开发者ID:ranji1221,项目名称:lemcloud,代码行数:16,代码来源:UserController.java

示例3: passwordService

import org.apache.shiro.authc.credential.DefaultPasswordService; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean
public PasswordService passwordService() {
    DefaultPasswordService service = new DefaultPasswordService();

    DefaultHashService hashService = new DefaultHashService();
    hashService.setHashAlgorithmName(shiroProperties.getHashAlgorithmName());
    hashService.setHashIterations(shiroProperties.getHashIterations());
    service.setHashService(hashService);

    return service;
}
 
开发者ID:storezhang,项目名称:utils,代码行数:13,代码来源:ShiroAutoConfiguration.java

示例4: PasswordRealmMixin

import org.apache.shiro.authc.credential.DefaultPasswordService; //导入依赖的package包/类
public PasswordRealmMixin()
{
    super();
    passwordService = new DefaultPasswordService();
    PasswordMatcher matcher = new PasswordMatcher();
    matcher.setPasswordService( passwordService );
    setCredentialsMatcher( matcher );
}
 
开发者ID:apache,项目名称:polygene-java,代码行数:9,代码来源:PasswordRealmMixin.java

示例5: MyRealmMixin

import org.apache.shiro.authc.credential.DefaultPasswordService; //导入依赖的package包/类
public MyRealmMixin()
{
    super();
    passwordService = new DefaultPasswordService();
    PasswordMatcher matcher = new PasswordMatcher();
    matcher.setPasswordService( passwordService );
    setCredentialsMatcher( matcher );
}
 
开发者ID:apache,项目名称:polygene-java,代码行数:9,代码来源:RealmServiceTest.java

示例6: DefaultSecurityPasswordService

import org.apache.shiro.authc.credential.DefaultPasswordService; //导入依赖的package包/类
@Inject
public DefaultSecurityPasswordService(@Named("legacy") final PasswordService legacyPasswordService) {
  this.passwordService = new DefaultPasswordService();
  this.legacyPasswordService = checkNotNull(legacyPasswordService);

  //Create and set a hash service according to our hashing policies
  DefaultHashService hashService = new DefaultHashService();
  hashService.setHashAlgorithmName(DEFAULT_HASH_ALGORITHM);
  hashService.setHashIterations(DEFAULT_HASH_ITERATIONS);
  hashService.setGeneratePublicSalt(true);
  this.passwordService.setHashService(hashService);
}
 
开发者ID:sonatype,项目名称:nexus-public,代码行数:13,代码来源:DefaultSecurityPasswordService.java

示例7: createPasswordService

import org.apache.shiro.authc.credential.DefaultPasswordService; //导入依赖的package包/类
/**
 * Creates the password service without registering it.
 * 
 * @param repo  the component repository, only used to register secondary items like lifecycle, not null
 * @return the password service, not null
 */
protected PasswordService createPasswordService(ComponentRepository repo) {
  DefaultHashService hashService = new DefaultHashService();
  hashService.setHashAlgorithmName(getHashAlgorithm());
  hashService.setHashIterations(getHashIterations());
  hashService.setGeneratePublicSalt(true);
  hashService.setPrivateSalt(new SimpleByteSource(getPrivateSalt()));
  DefaultPasswordService pwService = new DefaultPasswordService();
  pwService.setHashService(hashService);
  return pwService;
}
 
开发者ID:DevStreet,项目名称:FinanceAnalytics,代码行数:17,代码来源:ShiroSecurityComponentFactory.java

示例8: getPasswordService

import org.apache.shiro.authc.credential.DefaultPasswordService; //导入依赖的package包/类
public static HashingPasswordService getPasswordService() {
	DefaultHashService hashService = new DefaultHashService();
	hashService.setHashIterations(HASH_ITERATIONS);
	hashService.setHashAlgorithmName(Sha512Hash.ALGORITHM_NAME);
	hashService.setGeneratePublicSalt(true);

	DefaultPasswordService passwordService = new DefaultPasswordService();
	passwordService.setHashService(hashService);
	return passwordService;
}
 
开发者ID:mondo-project,项目名称:mondo-integration,代码行数:11,代码来源:UserStorage.java

示例9: setupShiro

import org.apache.shiro.authc.credential.DefaultPasswordService; //导入依赖的package包/类
protected static void setupShiro() {
    IniSecurityManagerFactory factory = new IniSecurityManagerFactory(); // ("classpath:shiro.ini");
    DefaultSecurityManager dsm = (DefaultSecurityManager) factory.getInstance();
    passwordService = (DefaultPasswordService) factory.getBeans().get("passwordService");
    passwordMatcher = (CredentialsMatcher) factory.getBeans().get("passwordMatcher");
    setSecurityManager(dsm);
}
 
开发者ID:Multifarious,项目名称:shiro-jdbi-realm,代码行数:8,代码来源:AbstractShiroTest.java

示例10: save

import org.apache.shiro.authc.credential.DefaultPasswordService; //导入依赖的package包/类
@Override
public void save(User entity) {
	entity.setPassword(new DefaultPasswordService().encryptPassword(entity.getPassword()));
	super.save(entity);
}
 
开发者ID:ranji1221,项目名称:clemon,代码行数:6,代码来源:UserServiceImpl.java

示例11: f0

import org.apache.shiro.authc.credential.DefaultPasswordService; //导入依赖的package包/类
@Test
public void f0() {
    DefaultPasswordService service = new DefaultPasswordService();
    System.out.println(service.encryptPassword("12sdf会计师考虑到付sdfsdf34").length());
    System.out.println(service.encryptPassword("1234"));
}
 
开发者ID:gittozji,项目名称:home,代码行数:7,代码来源:SecurityTest.java

示例12: passwordService

import org.apache.shiro.authc.credential.DefaultPasswordService; //导入依赖的package包/类
@Bean(name = "passwordService")
public DefaultPasswordService passwordService() {
    return new DefaultPasswordService();
}
 
开发者ID:auslides,项目名称:stateless-shiro,代码行数:5,代码来源:ShiroConfig.java

示例13: save

import org.apache.shiro.authc.credential.DefaultPasswordService; //导入依赖的package包/类
@Override
public void save(User entity) {
	entity.setUserPass(new DefaultPasswordService().encryptPassword(entity.getUserPass()));
	super.save(entity);
}
 
开发者ID:ranji1221,项目名称:lemcloud,代码行数:6,代码来源:UserServiceImpl.java

示例14: configure

import org.apache.shiro.authc.credential.DefaultPasswordService; //导入依赖的package包/类
@Override
protected void configure() {
    bind(DefaultPasswordService.class).to(PasswordService.class).in(Singleton.class);
}
 
开发者ID:protoxme,项目名称:protox-webapp-archetype,代码行数:5,代码来源:CustomBinder.java

示例15: passwordService

import org.apache.shiro.authc.credential.DefaultPasswordService; //导入依赖的package包/类
@Produces
@ShiroIni
@Named
public PasswordService passwordService() {
    return new DefaultPasswordService();
}
 
开发者ID:panchitoboy,项目名称:shiro-jwt,代码行数:7,代码来源:SecurityProducer.java


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