code: @VisibleForTesting
      byte[] RSADecrypt(byte[] encryptedInput) throws IncompatibleDeviceException, CryptoException {
          try {
              PrivateKey privateKey = getRSAKeyEntry().getPrivateKey();
              Cipher cipher = Cipher.getInstance(RSA_TRANSFORMATION);
              cipher.init(Cipher.DECRYPT_MODE, privateKey);
              return cipher.doFinal(encryptedInput);
          } catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException e) {
              /*
               * This exceptions are safe to be ignored:
               *
               * - NoSuchPaddingException:
               *      Thrown if PKCS1Padding is not available. Was introduced in API 1.
               * - NoSuchAlgorithmException:
               *      Thrown if the transformation is null, empty or invalid, or if no security provider
               *      implements it. Was introduced in API 1.
               * - InvalidKeyException:
               *      Thrown if the given key is inappropriate for initializing this cipher.
               *
               * Read more in https://developer.android.com/reference/javax/crypto/Cipher
               */
              Log.e(TAG, "The device can't decrypt input using a RSA Key.", e);
              throw new IncompatibleDeviceException(e);
          } catch (IllegalBlockSizeException | BadPaddingException e) {
              /*
               * Any of this exceptions mean the encrypted input is somehow corrupted and cannot be recovered.
               * Delete the AES keys since those originated the input.
               *
               * - IllegalBlockSizeException:
               *      Thrown only on encrypt mode.
               * - BadPaddingException:
               *      Thrown if the input doesn't contain the proper padding bytes.
               *
               */
              deleteAESKeys();
              throw new CryptoException("The RSA encrypted input is corrupted and cannot be recovered. Please discard it.", e);
          }
      }
docs: Decrypts the given input using a generated RSA Private Key.
  Used to decrypt the AES key for later usage.
  
  @param encryptedInput the input bytes to decrypt
  @return the decrypted bytes output
  @throws IncompatibleDeviceException in the event the device can't understand the cryptographic settings required
  @throws CryptoException             if the stored RSA keys can't be recovered and should be deemed invalid