mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-24 01:32:16 -05:00
Cleanup
This commit is contained in:
parent
878b5eb5ad
commit
e4e8bc5e07
@ -188,8 +188,7 @@ public class OpenPgpService extends RemoteService {
|
|||||||
}
|
}
|
||||||
if (passphrase == null) {
|
if (passphrase == null) {
|
||||||
// get PendingIntent for passphrase input, add it to given params and return to client
|
// get PendingIntent for passphrase input, add it to given params and return to client
|
||||||
Intent passphraseBundle = getPassphraseIntent(data, accSettings.getKeyId());
|
return getPassphraseIntent(data, accSettings.getKeyId());
|
||||||
return passphraseBundle;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
byte[] nfcSignedHash = data.getByteArrayExtra(OpenPgpApi.EXTRA_NFC_SIGNED_HASH);
|
byte[] nfcSignedHash = data.getByteArrayExtra(OpenPgpApi.EXTRA_NFC_SIGNED_HASH);
|
||||||
@ -231,9 +230,10 @@ public class OpenPgpService extends RemoteService {
|
|||||||
throw new Exception(getString(R.string.error_no_signature_key));
|
throw new Exception(getString(R.string.error_no_signature_key));
|
||||||
} catch (PgpSignEncrypt.NeedNfcDataException e) {
|
} catch (PgpSignEncrypt.NeedNfcDataException e) {
|
||||||
// return PendingIntent to execute NFC activity
|
// return PendingIntent to execute NFC activity
|
||||||
|
// pass through the signature creation timestamp to be used again on second execution
|
||||||
|
// of PgpSignEncrypt when we have the signed hash!
|
||||||
data.putExtra(OpenPgpApi.EXTRA_NFC_SIG_CREATION_TIMESTAMP, e.mCreationTimestamp.getTime());
|
data.putExtra(OpenPgpApi.EXTRA_NFC_SIG_CREATION_TIMESTAMP, e.mCreationTimestamp.getTime());
|
||||||
Intent nfcIntent = getNfcIntent(data, e.mHashToSign);
|
return getNfcIntent(data, e.mHashToSign);
|
||||||
return nfcIntent;
|
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
is.close();
|
is.close();
|
||||||
@ -315,8 +315,7 @@ public class OpenPgpService extends RemoteService {
|
|||||||
}
|
}
|
||||||
if (passphrase == null) {
|
if (passphrase == null) {
|
||||||
// get PendingIntent for passphrase input, add it to given params and return to client
|
// get PendingIntent for passphrase input, add it to given params and return to client
|
||||||
Intent passphraseBundle = getPassphraseIntent(data, accSettings.getKeyId());
|
return getPassphraseIntent(data, accSettings.getKeyId());
|
||||||
return passphraseBundle;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// sign and encrypt
|
// sign and encrypt
|
||||||
@ -411,9 +410,7 @@ public class OpenPgpService extends RemoteService {
|
|||||||
|
|
||||||
if (PgpDecryptVerifyResult.KEY_PASSHRASE_NEEDED == decryptVerifyResult.getStatus()) {
|
if (PgpDecryptVerifyResult.KEY_PASSHRASE_NEEDED == decryptVerifyResult.getStatus()) {
|
||||||
// get PendingIntent for passphrase input, add it to given params and return to client
|
// get PendingIntent for passphrase input, add it to given params and return to client
|
||||||
Intent passphraseBundle =
|
return getPassphraseIntent(data, decryptVerifyResult.getKeyIdPassphraseNeeded());
|
||||||
getPassphraseIntent(data, decryptVerifyResult.getKeyIdPassphraseNeeded());
|
|
||||||
return passphraseBundle;
|
|
||||||
} else if (PgpDecryptVerifyResult.SYMMETRIC_PASSHRASE_NEEDED ==
|
} else if (PgpDecryptVerifyResult.SYMMETRIC_PASSHRASE_NEEDED ==
|
||||||
decryptVerifyResult.getStatus()) {
|
decryptVerifyResult.getStatus()) {
|
||||||
throw new PgpGeneralException("Decryption of symmetric content not supported by API!");
|
throw new PgpGeneralException("Decryption of symmetric content not supported by API!");
|
||||||
@ -517,10 +514,8 @@ public class OpenPgpService extends RemoteService {
|
|||||||
return result;
|
return result;
|
||||||
} else {
|
} else {
|
||||||
// get key ids based on given user ids
|
// get key ids based on given user ids
|
||||||
|
|
||||||
String[] userIds = data.getStringArrayExtra(OpenPgpApi.EXTRA_USER_IDS);
|
String[] userIds = data.getStringArrayExtra(OpenPgpApi.EXTRA_USER_IDS);
|
||||||
Intent result = getKeyIdsFromEmails(data, userIds);
|
return getKeyIdsFromEmails(data, userIds);
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user