ParagonIE_Sodium_Compat::crypto_box_seal_open() public WP 1.0
Opens a message encrypted with crypto_box_seal(). Requires the recipient's keypair (sk || pk) to decrypt successfully.
This validates ciphertext integrity.
{} Это метод класса: ParagonIE_Sodium_Compat{}
Хуков нет.
Возвращает
Строку. The original plaintext message
Использование
$result = ParagonIE_Sodium_Compat::crypto_box_seal_open( $ciphertext, $keypair );
- $ciphertext(строка) (обязательный)
- Sealed message to be opened
- $keypair(строка) (обязательный)
- Your crypto_box keypair
Код ParagonIE_Sodium_Compat::crypto_box_seal_open() ParagonIE Sodium Compat::crypto box seal open WP 5.6.2
public static function crypto_box_seal_open($ciphertext, $keypair)
{
/* Type checks: */
ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1);
ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 2);
/* Input validation: */
if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== self::CRYPTO_BOX_KEYPAIRBYTES) {
throw new SodiumException('Argument 2 must be CRYPTO_BOX_KEYPAIRBYTES long.');
}
if (self::useNewSodiumAPI()) {
/**
* @psalm-suppress InvalidReturnStatement
* @psalm-suppress FalsableReturnStatement
*/
return sodium_crypto_box_seal_open($ciphertext, $keypair);
}
if (self::use_fallback('crypto_box_seal_open')) {
return call_user_func('\\Sodium\\crypto_box_seal_open', $ciphertext, $keypair);
}
if (PHP_INT_SIZE === 4) {
return ParagonIE_Sodium_Crypto32::box_seal_open($ciphertext, $keypair);
}
return ParagonIE_Sodium_Crypto::box_seal_open($ciphertext, $keypair);
}