Is there any iOS alternative available for below Android Code
public static String EncryptString(String value, String mod, String exp) {
String strEncryInfoData = "";
try {
BigInteger modulus = new
color:black">BigInteger(mod, 10);
BigInteger pubExp = new
color:black">BigInteger(exp, 10);
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
RSAPublicKeySpec pubKeySpec = new RSAPublicKeySpec(modulus, pubExp);
RSAPublicKey key = (RSAPublicKey) keyFactory.generatePublic(pubKeySpec);
Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");
cipher.init(Cipher.ENCRYPT_MODE, key);
byte[] cipherData = cipher.doFinal(value.getBytes());
strEncryInfoData = new String(org.apache.commons.codec.binary.Base64.encodeBase64(cipherData));
} catch
(Exception e) {
e.printStackTrace();
}
String result = strEncryInfoData.replaceAll("(\\r|\\n)", "");
int count =result.length() ;
return result;
}
public static String EncryptString(String value, String mod, String exp) {
String strEncryInfoData = "";
try {
BigInteger modulus = new
color:black">BigInteger(mod, 10);
BigInteger pubExp = new
color:black">BigInteger(exp, 10);
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
RSAPublicKeySpec pubKeySpec = new RSAPublicKeySpec(modulus, pubExp);
RSAPublicKey key = (RSAPublicKey) keyFactory.generatePublic(pubKeySpec);
Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");
cipher.init(Cipher.ENCRYPT_MODE, key);
byte[] cipherData = cipher.doFinal(value.getBytes());
strEncryInfoData = new String(org.apache.commons.codec.binary.Base64.encodeBase64(cipherData));
} catch
(Exception e) {
e.printStackTrace();
}
String result = strEncryInfoData.replaceAll("(\\r|\\n)", "");
int count =result.length() ;
return result;
}