title: Generate RSA Public Key from Modulus and Exponent
body: <p>I'm looking to generate a rsa public key (pem) from both the modulus and exponent in Objective-C. This function can be done in Java by the following;</p>
  
  <pre><code>PublicKey publicKey = KeyFactory.getInstance("RSA").generatePublic(new RSAPublicKeySpec(modulus, exponent));
  </code></pre>
  
  <p>Although I'm having some trouble writing this for the iOS platform. Am aware of <em><a href="https://github.com/x2on/OpenSSL-for-iPhone" rel="noreferrer">OpenSSL</a></em>, but I couldn't find a successful method and am still unable to generate this key. Also took a look at <em><a href="https://github.com/StCredZero/SCZ-BasicEncodingRules-iOS" rel="noreferrer">SCZ-BasicEncodingRules-iOS</a></em> but this returns a NSData value and I'm stuck trying to figure out how to try convert it to a NSString.</p>