array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'de', ), 'this' => array ( 0 => 'function.sodium-crypto-auth-verify.php', 1 => 'sodium_crypto_auth_verify', 2 => 'Verifies that the tag is valid for the message', ), 'up' => array ( 0 => 'ref.sodium.php', 1 => 'Sodium Funktionen', ), 'prev' => array ( 0 => 'function.sodium-crypto-auth-keygen.php', 1 => 'sodium_crypto_auth_keygen', ), 'next' => array ( 0 => 'function.sodium-crypto-box.php', 1 => 'sodium_crypto_box', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/sodium/functions/sodium-crypto-auth-verify.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

sodium_crypto_auth_verify

(PHP 7 >= 7.2.0, PHP 8)

sodium_crypto_auth_verifyVerifies that the tag is valid for the message

Beschreibung

sodium_crypto_auth_verify(string $mac, string $message, #[\SensitiveParameter] string $key): bool

Verify the authentication tag is valid for a given message and key.

Unlike with digital signatures (e.g. sodium_crypto_sign_verify_detached()), any party capable of verifying a message is also capable of authenticating their own messages. (Hence, symmetric authentication.)

Parameter-Liste

mac

Authentication tag produced by sodium_crypto_auth()

message

Message

key

Authentication key

Rückgabewerte

Gibt bei Erfolg true zurück. Bei einem Fehler wird false zurückgegeben.