aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain
diff options
context:
space:
mode:
authorDominik Schürmann <dominik@dominikschuermann.de>2014-09-07 23:19:55 +0200
committerDominik Schürmann <dominik@dominikschuermann.de>2014-09-07 23:19:55 +0200
commitfd7f1873641031b9dece88db0cf0dd18a94830a5 (patch)
treece3a6b2356209f3f67a696c79d8c389ecf4b1039 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain
parente6e70ec7d91d4cf4f2c5e371116b61e2c72a06ee (diff)
downloadopen-keychain-fd7f1873641031b9dece88db0cf0dd18a94830a5.tar.gz
open-keychain-fd7f1873641031b9dece88db0cf0dd18a94830a5.tar.bz2
open-keychain-fd7f1873641031b9dece88db0cf0dd18a94830a5.zip
Fix yubikey for signAndEncrypt via API
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java6
1 files changed, 6 insertions, 0 deletions
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 cc9912c30..00a9dc8f1 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java
@@ -354,6 +354,12 @@ public class OpenPgpService extends RemoteService {
throw new Exception(getString(R.string.error_wrong_passphrase));
} catch (PgpSignEncrypt.NoSigningKeyException e) {
throw new Exception(getString(R.string.error_no_signature_key));
+ } catch (PgpSignEncrypt.NeedNfcDataException e) {
+ // 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());
+ return getNfcIntent(data, e.mHashToSign, e.mHashAlgo);
}
} finally {
is.close();