(PHP 7 >= 7.2.0, PHP 8)
sodium_crypto_sign — Sign a message
sodium_crypto_sign(string $message, #[\SensitiveParameter] string $secret_key): string
Sign a message with a secret key, that can be verified by the corresponding public key. This function attaches the signature to the message. See sodium_crypto_sign_detached() for detached signatures.
messageMessage to sign.
secret_keySecret key. See sodium_crypto_sign_secretkey()
Signed message (not encrypted).
© 1997–2025 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later.
https://www.php.net/manual/en/function.sodium-crypto-sign.php