ParagonIE_Sodium_Compat::crypto_sign_open() public WP 1.0
Validates a signed message then returns the message.
{} Это метод класса: ParagonIE_Sodium_Compat{}
Хуков нет.
Возвращает
Строку. The original message (if the signature is valid for this public key)
Использование
$result = ParagonIE_Sodium_Compat::crypto_sign_open( $signedMessage, $publicKey );
- $signedMessage(строка) (обязательный)
- A signed message
- $publicKey(строка) (обязательный)
- A public key
Код ParagonIE_Sodium_Compat::crypto_sign_open() ParagonIE Sodium Compat::crypto sign open WP 5.6.2
public static function crypto_sign_open($signedMessage, $publicKey)
{
/* Type checks: */
ParagonIE_Sodium_Core_Util::declareScalarType($signedMessage, 'string', 1);
ParagonIE_Sodium_Core_Util::declareScalarType($publicKey, 'string', 2);
/* Input validation: */
if (ParagonIE_Sodium_Core_Util::strlen($signedMessage) < self::CRYPTO_SIGN_BYTES) {
throw new SodiumException('Argument 1 must be at least CRYPTO_SIGN_BYTES long.');
}
if (ParagonIE_Sodium_Core_Util::strlen($publicKey) !== self::CRYPTO_SIGN_PUBLICKEYBYTES) {
throw new SodiumException('Argument 2 must be CRYPTO_SIGN_PUBLICKEYBYTES long.');
}
if (self::useNewSodiumAPI()) {
/**
* @psalm-suppress InvalidReturnStatement
* @psalm-suppress FalsableReturnStatement
*/
return sodium_crypto_sign_open($signedMessage, $publicKey);
}
if (self::use_fallback('crypto_sign_open')) {
return call_user_func('\\Sodium\\crypto_sign_open', $signedMessage, $publicKey);
}
if (PHP_INT_SIZE === 4) {
return ParagonIE_Sodium_Crypto32::sign_open($signedMessage, $publicKey);
}
return ParagonIE_Sodium_Crypto::sign_open($signedMessage, $publicKey);
}