src/Leevel/Encryption/Encryption.php
protected function validateSign(string $value, string $sign): string
    {
        if (!$this->rsaPublic) {
            return $value;
        }

        try {
            $rsaPublic = openssl_pkey_get_public($this->rsaPublic);

            if (1 === openssl_verify($value, base64_decode($sign, true), $rsaPublic)) {
                return $value;
            }

            // 在 error_reporting(0) 场景下签名 $rsaPublic 错误的情况下才会执行
            throw new InvalidArgumentException('Openssl verify sign failed.');
        } catch (Throwable $e) {
            throw new InvalidArgumentException($e->getMessage());
        }
    }
protected function validateSign(string $value, string $sign): string
    {
        if (!$this->rsaPublic) {
            return $value;
        }

        try {
            $rsaPublic = openssl_pkey_get_public($this->rsaPublic);

            if (1 === openssl_verify($value, base64_decode($sign, true), $rsaPublic)) {
                return $value;
            }

            // 在 error_reporting(0) 场景下签名 $rsaPublic 错误的情况下才会执行
            throw new InvalidArgumentException('Openssl verify sign failed.');
        } catch (Throwable $e) {
            throw new InvalidArgumentException($e->getMessage());
        }
    }
验证签名.

@param string $value
@param string $sign

@return string