public static function authenticate(
        string $message,
        AuthenticationKey $secretKey,
        $encoding = Halite::ENCODE_BASE64URLSAFE
    ): string {
        $config = SymmetricConfig::getConfig(
            Halite::HALITE_VERSION,
            'auth'
        );
        /** @var string $mac */
        $mac = self::calculateMAC(
            $message,
            $secretKey->getRawKeyMaterial(),
            $config
        );
        $encoder = Halite::chooseEncoder($encoding);
        if ($encoder) {
            return (string) $encoder($mac);
        }
        return (string) $mac;
    }
public static function authenticate(
        string $message,
        AuthenticationKey $secretKey,
        $encoding = Halite::ENCODE_BASE64URLSAFE
    ): string {
        $config = SymmetricConfig::getConfig(
            Halite::HALITE_VERSION,
            'auth'
        );
        /** @var string $mac */
        $mac = self::calculateMAC(
            $message,
            $secretKey->getRawKeyMaterial(),
            $config
        );
        $encoder = Halite::chooseEncoder($encoding);
        if ($encoder) {
            return (string) $encoder($mac);
        }
        return (string) $mac;
    }
public static function authenticate ( string $ message , AuthenticationKey $ secretKey , $ encoding = Halite :: ENCODE_BASE64URLSAFE ) : string { $ config = SymmetricConfig :: getConfig ( Halite :: HALITE_VERSION , 'auth' ) ; /** @var string $mac */ $ mac = self :: calculateMAC ( $ message , $ secretKey -> getRawKeyMaterial ( ) , $ config ) ; $ encoder = Halite :: chooseEncoder ( $ encoding ) ; if ( $ encoder ) { return ( string ) $ encoder ( $ mac ) ; } return ( string ) $ mac ; }
Authenticate a string

@param string $message
@param AuthenticationKey $secretKey
@param mixed $encoding
@return string

@throws InvalidMessage
@throws InvalidType
@throws \TypeError
Authenticate a string