code: def import_rsa_key(pem_data):
      
      if not pem_data.startswith(PREFIX):
          pem_data = bytes('{}\n{}\n{}'.format(PREFIX, pem_data, POSTFIX),
                           'utf-8')
      else:
          pem_data = bytes(pem_data, 'utf-8')
      cert = x509.load_pem_x509_certificate(pem_data, default_backend())
      return cert.public_key()
docs: Extract an RSA key from a PEM-encoded X.509 certificate
  
      :param pem_data: RSA key encoded in standard form
      :return: rsa.RSAPublicKey instance