From 45b450e78a4aab5bac6fa61c78388b64f75b3b69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Fri, 11 Apr 2014 19:43:46 +0200 Subject: PgpDecryptVerify is now context-free --- .../sufficientlysecure/keychain/remote/OpenPgpService.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote') diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java index 91df79104..af916daba 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java @@ -300,7 +300,16 @@ public class OpenPgpService extends RemoteService { long inputLength = is.available(); InputData inputData = new InputData(is, inputLength); - PgpDecryptVerify.Builder builder = new PgpDecryptVerify.Builder(this, inputData, os); + PgpDecryptVerify.Builder builder = new PgpDecryptVerify.Builder( + new ProviderHelper(this), + new PgpDecryptVerify.PassphraseCache() { + @Override + public String getCachedPassphrase(long masterKeyId) { + return PassphraseCacheService.getCachedPassphrase( + OpenPgpService.this, masterKeyId); + } + }, + inputData, os); builder.allowSymmetricDecryption(false) // no support for symmetric encryption .allowedKeyIds(allowedKeyIds) // allow only private keys associated with // accounts of this app -- cgit v1.2.3