ParagonIE_Sodium_Compat::crypto_sign_detached() public WP 1.0
Calculate the Ed25519 signature of a message and return ONLY the signature.
Algorithm: Ed25519 (EdDSA over Curve25519)
{} Это метод класса: ParagonIE_Sodium_Compat{}
Хуков нет.
Возвращает
Строку
. Digital signature
Использование
$result = ParagonIE_Sodium_Compat::crypto_sign_detached( $message, $secretKey );
- $message(строка) (обязательный)
- Message to be signed
- $secretKey(строка) (обязательный)
- Secret signing key
Код ParagonIE_Sodium_Compat::crypto_sign_detached() ParagonIE Sodium Compat::crypto sign detached WP 5.7
public static function crypto_sign_detached($message, $secretKey)
{
/* Type checks: */
ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1);
ParagonIE_Sodium_Core_Util::declareScalarType($secretKey, 'string', 2);
/* Input validation: */
if (ParagonIE_Sodium_Core_Util::strlen($secretKey) !== self::CRYPTO_SIGN_SECRETKEYBYTES) {
throw new SodiumException('Argument 2 must be CRYPTO_SIGN_SECRETKEYBYTES long.');
}
if (self::useNewSodiumAPI()) {
return sodium_crypto_sign_detached($message, $secretKey);
}
if (self::use_fallback('crypto_sign_detached')) {
return (string) call_user_func('\\Sodium\\crypto_sign_detached', $message, $secretKey);
}
if (PHP_INT_SIZE === 4) {
return ParagonIE_Sodium_Crypto32::sign_detached($message, $secretKey);
}
return ParagonIE_Sodium_Crypto::sign_detached($message, $secretKey);
}