Example usage for org.apache.shiro.crypto.hash Sha512Hash ALGORITHM_NAME

List of usage examples for org.apache.shiro.crypto.hash Sha512Hash ALGORITHM_NAME

Introduction

In this page you can find the example usage for org.apache.shiro.crypto.hash Sha512Hash ALGORITHM_NAME.

Prototype

String ALGORITHM_NAME

To view the source code for org.apache.shiro.crypto.hash Sha512Hash ALGORITHM_NAME.

Click Source Link

Usage

From source file:org.abstractj.authz.SecurityRealm.java

License:Apache License

public SecurityRealm() {
    setName("SecurityRealm");
    setCredentialsMatcher(new HashedCredentialsMatcher(Sha512Hash.ALGORITHM_NAME));
    identityManagement = getIdentityManagement();
}

From source file:org.hawk.service.server.users.servlet.db.UserStorage.java

License:Open Source License

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;
}

From source file:org.jboss.aerogear.security.shiro.authz.SecurityRealm.java

License:Apache License

public SecurityRealm() {
    setName("SecurityRealm");
    setCredentialsMatcher(new HashedCredentialsMatcher(Sha512Hash.ALGORITHM_NAME));
}

From source file:org.obiba.agate.security.AgateUserRealm.java

License:Open Source License

@PostConstruct
public void postConstruct() {

    setCacheManager(new MemoryConstrainedCacheManager());

    RelaxedPropertyResolver propertyResolver = new RelaxedPropertyResolver(env, "shiro.password.");
    nbHashIterations = propertyResolver.getProperty("nbHashIterations", Integer.class);

    HashedCredentialsMatcher credentialsMatcher = new HashedCredentialsMatcher(Sha512Hash.ALGORITHM_NAME);
    credentialsMatcher.setHashIterations(nbHashIterations);
    setCredentialsMatcher(credentialsMatcher);

    salt = propertyResolver.getProperty("salt");
}

From source file:org.obiba.opal.core.service.security.realm.OpalUserRealm.java

License:Open Source License

@PostConstruct
public void postConstruct() {

    setCacheManager(new MemoryConstrainedCacheManager());

    HashedCredentialsMatcher credentialsMatcher = new HashedCredentialsMatcher(Sha512Hash.ALGORITHM_NAME);
    credentialsMatcher.setHashIterations(nbHashIterations);
    setCredentialsMatcher(credentialsMatcher);

    salt = opalConfigurationService.getOpalConfiguration().getSecretKey();
}

From source file:org.qi4j.library.shiro.crypto.HashFactory.java

License:Open Source License

public static Hash create(String algorithmName, Object source, Object salt, int hashIterations) {
    if (algorithmName == null || algorithmName.length() <= 0) {
        throw new IllegalArgumentException("Algorithm name was null or empty");
    }//from  w  w w  .j ava2  s.co  m
    if (!Arrays.asList(VALID_ALGORITHM_NAMES).contains(algorithmName)) {
        throw new IllegalArgumentException(algorithmName + " is not a valid algorithm. Valid ones are : "
                + Arrays.toString(VALID_ALGORITHM_NAMES));
    }
    if (Md2Hash.ALGORITHM_NAME.equals(algorithmName)) {
        return new Md2Hash(source, salt, hashIterations);
    }
    if (Md5Hash.ALGORITHM_NAME.equals(algorithmName)) {
        return new Md5Hash(source, salt, hashIterations);
    }
    if (Sha1Hash.ALGORITHM_NAME.equals(algorithmName)) {
        return new Sha1Hash(source, salt, hashIterations);
    }
    if (Sha256Hash.ALGORITHM_NAME.equals(algorithmName)) {
        return new Sha256Hash(source, salt, hashIterations);
    }
    if (Sha384Hash.ALGORITHM_NAME.equals(algorithmName)) {
        return new Sha384Hash(source, salt, hashIterations);
    }
    if (Sha512Hash.ALGORITHM_NAME.equals(algorithmName)) {
        return new Sha512Hash(source, salt, hashIterations);
    }
    throw new InternalError("You shall not pass!");
}

From source file:org.thlim.security.ScopedRoleRealm.java

License:Apache License

public ScopedRoleRealm() {
    setName("ScopedRoleRealm"); // This name must match the name in the User class's getPrincipals()  method
    HashedCredentialsMatcher matcher = new HashedCredentialsMatcher();
    matcher.setHashAlgorithmName(Sha512Hash.ALGORITHM_NAME);
    setCredentialsMatcher(matcher);//  w  w  w .j  a v  a  2  s .  c  o m
}