title: iOS swift3 equivalent of "RSA/NONE/OAEPWithSHA256AndMGF1Padding"
body: <p>I am getting decryption error on sever when I used SwiftyRSA to encrypt a text using publicKey on client.</p>
  
  <p>I have referred this 
  <a href="https://stackoverflow.com/questions/26108672/rsa-encrypt-in-ios-decrypt-in-java">RSA: encrypt in iOS, decrypt in Java</a> but this is for SHA1. </p>
  
  <p>I am using <a href="https://github.com/TakeScoop/SwiftyRSA" rel="nofollow noreferrer">https://github.com/TakeScoop/SwiftyRSA</a> library.</p>
  
  <p><code>kSecPaddingOAEP</code> and <code>RSA/NONE/OAEPWithSHA1AndMGF1Padding</code> works. But how Can I make it work for <code>RSA/NONE/OAEPWithSHA256AndMGF1Padding</code></p>
  
  <pre><code>let str = "Clear Text"
  let clear = try ClearMessage(string: str, using: .utf8)    
  let encrypted = try clear.encrypted(with: publicKey, padding: .OAEP)
  </code></pre>
  
  <p>I want to encrypt data in swift3 without touching server code.</p>