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

Node.js v6 includes a module that provides cryptographic functionality, including sign and verification functions.

If there is no way to sign or verify signatures, is there perhaps a way to connect the Node.js module to Cordova or Phonegap?

Basically I need a way to sign messages and verify the signature from the Cordova application.

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

+5
source share
3 answers

I found what I was looking for:

http://kjur.imtqy.com/jsrsasign/

Here is a demonstration of how to create, sign, and verify keys: http://kjur.imtqy.com/jsrsasign/sample-ecdsa.html

Incredible, this is pure javascript. This will work on both iOS and Android platforms.

My only concern is knowing how to safely use this library to generate keys. At least I can generate the keys and send them using a secure channel, later sign / confirm using the application.

+2
source

Android has a class for signing and verifying signatures, exactly named Signature . IOS has similar functionality. Write the cordova plugin that wraps these classes.

In addition to some of the basic features provided by webview, everything in cordova is provided through plugins that use the underlying platform. Thus, in Cordoba you can sign or verify signatures. But it may be more effort than you are prepared.

+1
source

It is not possible to execute Node code inside a cordova application, only in intercepts, but there are several cryptographic libraries in javascript that can help you

Check cryptojs or this plugin for Cordova

0
source

All Articles