I want to get RSA Public Key which is used before making payments. I have a JAVA Code but unable to find similar code in swift 4. Can you please help me out, I'm really stuck at this point. Here is the code for JAVA.

public static PublicKey getPublicKey(final BigInteger modulus, final BigInteger exponent) throws Exception {

final KeyFactory factory = KeyFactory.getInstance("RSA");

final PublicKey publicKey = factory.generatePublic(new RSAPublicKeySpec(modulus, exponent));

return publicKey; }

Thanks in advance.