title: how to import public key into RSA for encrypt in .net core
body: <p>I have publicKey.key, I want to import that to rsa encrypt</p>
  
  <p>this is my code :</p>
  
  <pre><code>using (RSA rsa = RSA.Create())
  {
      var key = Encoding.UTF8.GetBytes("012345678901234567890");
  
      byte[] publicKey = File.ReadAllBytes("text/publicKey.key");
  
      var result = rsa.Encrypt(key, RSAEncryptionPadding.Pkcs1);
  }
  </code></pre>