List of usage examples for org.apache.shiro.crypto.hash.format HexFormat HexFormat
HexFormat
From source file:cn.powerdash.libsystem.common.security.authc.PrivateSaltPasswordService.java
License:Open Source License
public PrivateSaltPasswordService() { super();//from w w w .j a v a 2 s. co m HashService hashService = getHashService(); if (hashService instanceof DefaultHashService) { ((DefaultHashService) hashService).setPrivateSalt(new SimpleByteSource(PRIVATE_SALT)); } DefaultHashService hashServiceInstance = new DefaultHashService(); hashServiceInstance.setHashAlgorithmName("MD5"); this.md5HashService = hashServiceInstance; hexHashFormat = new HexFormat(); this.defaultHashService = super.getHashService(); defaultHashFormat = super.getHashFormat(); }
From source file:org.sonatype.nexus.security.internal.LegacyNexusPasswordService.java
License:Open Source License
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()); }