Intel

Developer Zone

HashAlg

com.intel.crypto

Class HashAlg

  • java.lang.Object
    • 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 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
      • HASH_TYPE_SHA512

        public static final short HASH_TYPE_SHA512
        SHA512 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
      • SHA512_HASH_LENGTH

        public static final short SHA512_HASH_LENGTH
        SHA512 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