diff options
Diffstat (limited to 'OpenPGP-Keychain-API/example-app/src/main/java/org/sufficientlysecure/keychain/demo/OpenPgpProviderActivity.java')
-rw-r--r-- | OpenPGP-Keychain-API/example-app/src/main/java/org/sufficientlysecure/keychain/demo/OpenPgpProviderActivity.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/OpenPGP-Keychain-API/example-app/src/main/java/org/sufficientlysecure/keychain/demo/OpenPgpProviderActivity.java b/OpenPGP-Keychain-API/example-app/src/main/java/org/sufficientlysecure/keychain/demo/OpenPgpProviderActivity.java index ef40ee5ac..2f7f085c2 100644 --- a/OpenPGP-Keychain-API/example-app/src/main/java/org/sufficientlysecure/keychain/demo/OpenPgpProviderActivity.java +++ b/OpenPGP-Keychain-API/example-app/src/main/java/org/sufficientlysecure/keychain/demo/OpenPgpProviderActivity.java @@ -31,6 +31,7 @@ import android.widget.EditText; import android.widget.Toast; import org.openintents.openpgp.OpenPgpError; +import org.openintents.openpgp.OpenPgpSignatureResult; import org.openintents.openpgp.util.OpenPgpApi; import org.openintents.openpgp.util.OpenPgpConstants; import org.openintents.openpgp.util.OpenPgpServiceConnection; @@ -121,6 +122,18 @@ public class OpenPgpProviderActivity extends Activity { }); } + private void handleSignature(final OpenPgpSignatureResult sigResult) { + runOnUiThread(new Runnable() { + + @Override + public void run() { + Toast.makeText(OpenPgpProviderActivity.this, + sigResult.toString(), + Toast.LENGTH_LONG).show(); + } + }); + } + /** * Takes input from message or ciphertext EditText and turns it into a ByteArrayInputStream * @@ -171,6 +184,12 @@ public class OpenPgpProviderActivity extends Activity { } catch (UnsupportedEncodingException e) { Log.e(Constants.TAG, "UnsupportedEncodingException", e); } + + if (result.containsKey(OpenPgpConstants.RESULT_SIGNATURE)) { + OpenPgpSignatureResult sigResult + = result.getParcelable(OpenPgpConstants.RESULT_SIGNATURE); + handleSignature(sigResult); + } break; } case OpenPgpConstants.RESULT_CODE_USER_INTERACTION_REQUIRED: { |