code: def rsa_encrypt(data, pem, b64_encode=True):
      
      from cryptography.hazmat.backends import default_backend
      from cryptography.hazmat.primitives import serialization
      from cryptography.hazmat.primitives import hashes
      from cryptography.hazmat.primitives.asymmetric import padding
      encoded_data = to_binary(data)
      pem = to_binary(pem)
      public_key = serialization.load_pem_public_key(pem, backend=default_backend())
      encrypted_data = public_key.encrypt(
          encoded_data,
          padding=padding.OAEP(
              mgf=padding.MGF1(hashes.SHA1()),
              algorithm=hashes.SHA1(),
              label=None,
          )
      )
      if b64_encode:
          encrypted_data = base64.b64encode(encrypted_data).decode('utf-8')
      return encrypted_data
docs: rsa 加密
      :param data: 待加密字符串/binary
      :param pem: RSA public key 内容/binary
      :param b64_encode: 是否对输出进行 base64 encode
      :return: 如果 b64_encode=True 的话，返回加密并 base64 处理后的 string；否则返回加密后的 binary