Search code examples
javascriptcordovaphonegap-pluginscordova-plugins

Is it possible to generate digital signatures in Phonegap/Cordova App?


Node.js v6 includes a module that provide cryptographic functionality, including sign and verify functions.

If there isn't a way to sign or verify signatures maybe is there a way to port Node.js module to Cordova or Phonegap?

Basically what i need is way to sign messages and verify the signature from a Cordova App.

https://nodejs.org/dist/latest-v6.x/docs/api/crypto.html#crypto_class_sign


Solution

  • I found what i was looking for:

    http://kjur.github.io/jsrsasign/

    Here a demo of how to generate,sign and verify keys: http://kjur.github.io/jsrsasign/sample-ecdsa.html

    Incredible, it's pure javascript. So is going to work in both platforms iOS and Android.

    My only concerns is to know how secure is use this library for key generation. At least i can generate the keys and send it using secure channel, later sign/verify using the App.