How to generate KeyPair in IOS and Android using Cordova? -
i creating banking app using angularjs1 , ionic1 ios , android. due security concerns clients device should generate public , private key using sha/rsa. don't want use javascript plugin, strictly denied client. digged lot, openssl , letsencrypt options left far know. both websites discuss manual command prompt key generation on operating system. want mechanism can:
- generate keypair on device.
- generate json web key(jwk).
- sign/hash data using private key. below reference in .net/java(i want in cordova)
signature = rsa256signdata(asciibytes(data signed), rsaprivatekey)
encoded signature = base64encode(signature)
i couldn't find cordova plugin can handle this. if there no cordova plugin i'll glad if can tell me in pieces or native.
thanks.
i not know of cordova plugin can accomplish these tasks.
there excellent javascript libraries provide these functions. have @ node-jose allows work jwk, jwe , jws. library depends on (a altered version of) node-forge can anything, including generating keypair , signing/hashing data.
the drawback of using these libraries speed may not sufficient mobile devices need support. personal experience mobile devices capable of working 1024-bit keypairs. working 2048-bits slow , generating 2048-bit pair takes long on devices.
Comments
Post a Comment