cordova-safe
v2.0.1
Published
Simple file crypto for Cordova.
Downloads
9
Maintainers
Readme
cordova-safe
Simple file encryption for Cordova.
Install
$ cordova plugin add cordova-safe
Usage
var safe = cordova.plugins.disusered.safe,
key = 'someKey';
function success(encryptedFile) {
console.log('Encrypted file: ' + encryptedFile);
safe.decrypt(encryptedFile, key, function(decryptedFile) {
console.log('Decrypted file: ' + decryptedFile);
}, error);
}
function error() {
console.log('Error with cryptographic operation');
}
safe.encrypt('file:/storage/sdcard/DCIM/Camera/1404177327783.jpg', key, success, error);
API
The plugin exposes the following methods:
cordova.plugins.disusered.safe.encrypt(file, key, success, error);
cordova.plugins.disusered.safe.decrypt(file, key, success, error);
Parameters:
- file: A string representing a local URI
- key: A key for the crypto operations
- success: Optional success callback
- error: Optional error callback
License
MIT © Carlos Rosquillas