yakivmospan / scytale

One tool to manage key generation, key storing and encryption on different APIs of Android.
432 stars 45 forks source link

What happens when decryption fails? #9

Closed mradzinski closed 7 years ago

mradzinski commented 7 years ago

It is not very clear what happens whenever a decryption fails. If I provide a wrongly encrypted data to the decrypt method then the decryption must fail, however, does this throws an error or simply returns null?

yakivmospan commented 7 years ago

In current version :

  1. Short error log is printed out.
  2. On error call back is triggered.
  3. Method returns null.

To setup an error listener use :

crypto.setErrorListener(new ErrorListener() {
     @Override
      public void onError(Exception e) {
         // handle error
      }
});

store.setErrorListener(new ErrorListener() {
    @Override
     public void onError(Exception e) {
         // handle error
     }
});
mradzinski commented 7 years ago

Got it. Thanks!

On Mon, 17 Apr 2017, 01:39 Yakiv Mospan, notifications@github.com wrote:

In current version :

  1. Short error log is printed out.
  2. On error call back is triggered.
  3. Method returns null.

To setup an error listener use :

crypto.setErrorListener(new ErrorListener() { @Override public void onError(Exception e) { // handle error } });

store.setErrorListener(new ErrorListener() { @Override public void onError(Exception e) { // handle error } });

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/yakivmospan/scytale/issues/9#issuecomment-294403687, or mute the thread https://github.com/notifications/unsubscribe-auth/AEBNwRs9WPvqr0cANjZlXRGOYO62_Iotks5rwuz8gaJpZM4M-uuo .