src/Leevel/Encryption/Encryption.php
protected function normalizeSign(string $value): string
    {
        if (!$this->rsaPrivate) {
            return '';
        }

        try {
            $rsaPrivate = openssl_pkey_get_private($this->rsaPrivate);

            if (openssl_sign($value, $sign, $rsaPrivate)) {
                return base64_encode($sign);
            }

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

        try {
            $rsaPrivate = openssl_pkey_get_private($this->rsaPrivate);

            if (openssl_sign($value, $sign, $rsaPrivate)) {
                return base64_encode($sign);
            }

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

@param string $value

@return string