org.apache.shiro.authc.credential
Class Sha512CredentialsMatcher

java.lang.Object
  extended by org.apache.shiro.codec.CodecSupport
      extended by org.apache.shiro.authc.credential.SimpleCredentialsMatcher
          extended by org.apache.shiro.authc.credential.HashedCredentialsMatcher
              extended by org.apache.shiro.authc.credential.Sha512CredentialsMatcher
All Implemented Interfaces:
CredentialsMatcher

public class Sha512CredentialsMatcher
extends HashedCredentialsMatcher

HashedCredentialsMatcher implementation that expects the stored AuthenticationInfo credentials to be SHA-512 hashed.

Since:
0.9
Author:
Les Hazlewood

Field Summary
 
Fields inherited from class org.apache.shiro.codec.CodecSupport
PREFERRED_ENCODING
 
Constructor Summary
Sha512CredentialsMatcher()
           
 
Method Summary
protected  Hash hashProvidedCredentials(Object credentials, Object salt, int hashIterations)
          This implementation merely returns new Sha512Hash(credentials,salt,hashIterations).
protected  AbstractHash newHashInstance()
          Creates a new uninitialized Sha512Hash instance, without it's byte array set.
 
Methods inherited from class org.apache.shiro.authc.credential.HashedCredentialsMatcher
getCredentials, getCredentials, getHashIterations, getSalt, isHashSalted, isStoredCredentialsHexEncoded, setHashIterations, setHashSalted, setStoredCredentialsHexEncoded
 
Methods inherited from class org.apache.shiro.authc.credential.SimpleCredentialsMatcher
doCredentialsMatch, equals
 
Methods inherited from class org.apache.shiro.codec.CodecSupport
isByteSource, objectToBytes, objectToString, toBytes, toBytes, toBytes, toBytes, toBytes, toBytes, toBytes, toChars, toChars, toString, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sha512CredentialsMatcher

public Sha512CredentialsMatcher()
Method Detail

newHashInstance

protected AbstractHash newHashInstance()
Creates a new uninitialized Sha512Hash instance, without it's byte array set.

Specified by:
newHashInstance in class HashedCredentialsMatcher
Returns:
a new uninitialized Sha512Hash instance, without it's byte array set.

hashProvidedCredentials

protected Hash hashProvidedCredentials(Object credentials,
                                       Object salt,
                                       int hashIterations)
This implementation merely returns new Sha512Hash(credentials,salt,hashIterations).

Specified by:
hashProvidedCredentials in class HashedCredentialsMatcher
Parameters:
credentials - the submitted authentication token's credentials to hash
salt - the value to salt the hash, or null if a salt will not be used.
hashIterations - the number of times to hash the credentials. At least one hash will always occur though, even if this argument is 0 or negative.
Returns:
the hashed value of the provided credentials, according to the specified salt and hash iterations.


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.