Intel

Developer Zone

HashAlg


com.intel.crypto
Class HashAlg

java.lang.Object
  extended by com.intel.crypto.HashAlg
All Implemented Interfaces:
Hash

public abstract class HashAlg
extends java.lang.Object
implements Hash

This abstract class represents a hash algorithm. This class implements the hash algorithm interface and creates specific hash algorithm implementations using the create factory method.


Field Summary
static short HASH_TYPE_SHA1
SHA1 hash algorithm.
static short HASH_TYPE_SHA256
SHA256 hash algorithm,
static short SHA1_HASH_LENGTH
SHA1 hash length in bytes.
static short SHA256_HASH_LENGTH
SHA256 hash length in bytes.
Method Summary
static HashAlg create(short algType)
Factory method for creating a concrete instance.
short getHashAlg()
Returns the hash algorithm used by this hash instance.
Methods inherited from class java.lang.Object
equals, hashCode, toString
Methods inherited from interface com.intel.crypto.Hash
getHashLength, processComplete, processUpdate

Field Detail

HASH_TYPE_SHA1

public static final short HASH_TYPE_SHA1
SHA1 hash algorithm.

See Also:
Constant Field Values

HASH_TYPE_SHA256

public static final short HASH_TYPE_SHA256
SHA256 hash algorithm,

See Also:
Constant Field Values

SHA1_HASH_LENGTH

public static final short SHA1_HASH_LENGTH
SHA1 hash length in bytes.

See Also:
Constant Field Values

SHA256_HASH_LENGTH

public static final short SHA256_HASH_LENGTH
SHA256 hash length in bytes.

See Also:
Constant Field Values
Method Detail

getHashAlg

public short getHashAlg()
Returns the hash algorithm used by this hash instance.

Specified by:
getHashAlg in interface Hash
Returns:
The hash algorithm used.

create

public static final HashAlg create(short algType)
                            throws CryptoException
Factory method for creating a concrete instance.

Parameters:
algType - the requested hash algorithm, see HASH_TYPE_... definitions above for the possible values
Returns:
HashAlg instance of the requested hash type.
Throws:
NotSupportedException - if the requested algorithm is not supported
CryptoException