public static function rsaPublicEncrypt(
        $str,
        $publicKeyPath,
        $padding = OPENSSL_PKCS1_PADDING,
        $format = self::FORMAT_HEX
    )
    {
        openssl_public_encrypt(
            trim($str),
            $cryrted,
            openssl_get_publickey(file_get_contents($publicKeyPath)),
            $padding
        );

        $cryrted = trim($cryrted);

        switch ($format) {
            case self::FORMAT_HEX:
                return bin2hex($cryrted);
            case self::FORMAT_BASE64:
                return EncodeHelper::base64Encode($cryrted);
        }

        return bin2hex($cryrted);
    }