PHP - Manual: sodium_crypto_auth_verify
2024-12-21
(PHP 7 >= 7.2.0, PHP 8)
sodium_crypto_auth_verify — Verifies that the tag is valid for the message
$mac
, string $message
, string $key
): boolVerify 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.)
mac
Authentication tag produced by sodium_crypto_auth()
message
Message
key
Authentication key
成功时返回 true
, 或者在失败时返回 false
。
官方地址:https://www.php.net/manual/en/function.sodium-crypto-auth-verify.php