How to generate KeyPair in IOS and Android using Cordova?


#1

I am creating a banking app using angularjs1 and ionic1 for IOS and Android. Due to some security concerns from clients the device should generate public and private key using SHA/RSA. I don’t want to use any javascript plugin, strictly denied by the client. I digged a lot, OpenSSL and Let’sEncypt are the only options left as far as I know.
Both the websites discuss manual command prompt key generation on an operating system. I want a mechanism where I can :

  1. Generate keypair on the device.
  2. Generate Json Web Key.
  3. Sign/Hash the data using private key. Below is a reference in .net/Java(I want this in cordova)

signature = RSA256SignData(ASCIIBytes(data to be signed), rsaPrivateKey)
Encoded Signature = Base64Encode(signature)

I couldn’t find any cordova plugin which can handle this. If there is no cordova plugin I’ll be glad if anyone can tell me to do this in pieces or anything which is native.

Thanks.