public static function generate(Array $aValues, WirecardCEE_Stdlib_FingerprintOrder $oFingerprintOrder)
    {
        if (self::$_HASH_ALGORITHM == self::HASH_ALGORITHM_HMAC_SHA512) {
            $secret = isset( $aValues['secret'] ) && !empty( $aValues['secret'] ) ? $aValues['secret'] : '';
            if (!strlen($secret)) {
                throw new WirecardCEE_Stdlib_Exception_UnexpectedValueException();
            }
            $hash   = hash_init(self::HASH_ALGORITHM_SHA512, HASH_HMAC, $secret);
        } else {
            $hash = hash_init(self::$_HASH_ALGORITHM);
        }
        foreach ($oFingerprintOrder as $key) {
            $key = (string) $key;

            if (array_key_exists($key, $aValues)) {
                hash_update($hash, ( self::$_STRIP_SLASHES ) ? stripslashes($aValues[$key]) : $aValues[$key]);
            } else {
                throw new WirecardCEE_Stdlib_Exception_InvalidValueException('Value for key ' . strtoupper($key) . ' not found in values array.');
            }
        }

        return hash_final($hash);
    }