title: Python3 RSA publickKey encryption
body: <p>I got a public key to work with and I need to cipher some text with the public RSA key I got.</p>
  <p>This is the code I have so far:</p>
  <pre><code>import rsa
  
  fKey = open('key','r')
  publicKey = fKey.read()
  
  cipher = rsa.encrypt('Test', publicKey)
  print(cipher)
  </code></pre>
  <p>With this code I keep getting this error:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;login.py&quot;, line 30, in &lt;module&gt;
      cipher = rsa.encrypt('Test', publicKey)
    File &quot;/home/vagrant/.local/lib/python3.8/site-packages/rsa/pkcs1.py&quot;, line 169, in encrypt
      keylength = common.byte_size(pub_key.n)
  AttributeError: 'str' object has no attribute 'n'
  </code></pre>
  <p>Can someone please point me in the right direction?</p>
  <p><strong>Note: I must use that public key file</strong></p>