ApiSignature

Phonegap/Cordova Api Signature plugin. This plugin provides an implementation of the (SHA-1, SHA-224, SHA-256, SHA-384, and SHA-512).
Dmitriy Devayev1.0.01
platforms: ios,android
$ cordova plugin add com.setlevel.apisignature

phonegap-api-signature-plugin

PayPal - The safer, easier way to pay online!

This plugin provides an implementation of the (SHA-1, SHA-224, SHA-256, SHA-384, and SHA-512)

Important

Android do not support SHA-224

Supported platforms

  • iOS
  • Android

Installation

Cordova CLI
cordova plugin add com.setlevel.apisignature

or

cordova plugin add https://github.com/Blah2014/phonegap-api-signature-plugin
Phonegap CLI
phonegap local plugin add https://github.com/Blah2014/phonegap-api-signature-plugin
plugman CLI
plugman --platform ios --project ./platforms/ios --plugin https://github.com/Blah2014/phonegap-api-signature-plugin

Usage

// SHA-1
<script>
    ApiSignature.createApiSignature(str, 'sha-1', function(sig){
      alert('Signature: ' + sig)
    });
</script>

// SHA-224
<script>
    ApiSignature.createApiSignature(str, 'sha-224', function(sig){
      alert('Signature: ' + sig)
    });
</script>

// SHA-256
<script>
    ApiSignature.createApiSignature(str, 'sha-256', function(sig){
      alert('Signature: ' + sig)
    });
</script>

// SHA-384
<script>
    ApiSignature.createApiSignature(str, 'sha-384', function(sig){
      alert('Signature: ' + sig)
    });
</script>

// SHA-512
<script>
    ApiSignature.createApiSignature(str, 'sha-512', function(sig){
      alert('Signature: ' + sig)
    });
</script>

Insert ApiSignature Secret_Key

iOS

In CDVApiSignature.m replace "Secret_Key" with your Secret_Key from API.

Android

In CDVApiSignature.java replace "Secret_Key" with your Secret_Key from API.