org.apache.shiro.crypto.hash
Class Sha256Hash

java.lang.Object
  extended by org.apache.shiro.codec.CodecSupport
      extended by org.apache.shiro.crypto.hash.AbstractHash
          extended by org.apache.shiro.crypto.hash.SimpleHash
              extended by org.apache.shiro.crypto.hash.Sha256Hash
All Implemented Interfaces:
Serializable, Hash, ByteSource

public class Sha256Hash
extends SimpleHash

Generates an SHA-256 Hash from a given input source with an optional salt and hash iterations.

See the SimpleHash parent class JavaDoc for a detailed explanation of Hashing techniques and how the overloaded constructors function.

JDK Version Note - Attempting to instantiate this class on JREs prior to version 1.4.0 will throw an IllegalStateException

Since:
0.9
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.shiro.util.ByteSource
ByteSource.Util
 
Field Summary
static String ALGORITHM_NAME
           
 
Fields inherited from class org.apache.shiro.codec.CodecSupport
PREFERRED_ENCODING
 
Constructor Summary
Sha256Hash()
           
Sha256Hash(Object source)
           
Sha256Hash(Object source, Object salt)
           
Sha256Hash(Object source, Object salt, int hashIterations)
           
 
Method Summary
static Sha256Hash fromBase64String(String base64)
           
static Sha256Hash fromHexString(String hex)
           
 
Methods inherited from class org.apache.shiro.crypto.hash.SimpleHash
convertSaltToBytes, convertSourceToBytes, equals, getAlgorithmName, getBytes, getDigest, getIterations, getSalt, hash, hash, hash, hashCode, isEmpty, setBytes, setIterations, setSalt, toBase64, toByteSource, toHex, toString
 
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, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ALGORITHM_NAME

public static final String ALGORITHM_NAME
See Also:
Constant Field Values
Constructor Detail

Sha256Hash

public Sha256Hash()

Sha256Hash

public Sha256Hash(Object source)

Sha256Hash

public Sha256Hash(Object source,
                  Object salt)

Sha256Hash

public Sha256Hash(Object source,
                  Object salt,
                  int hashIterations)
Method Detail

fromHexString

public static Sha256Hash fromHexString(String hex)

fromBase64String

public static Sha256Hash fromBase64String(String base64)


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