From b42636ec3ec63bef61af264a0a9b09998db8186b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Thu, 30 Jul 2015 21:36:28 +0200 Subject: New OpenPgpDecryptionResult, introduce UNSIGNED, UNENCRYPTED results instead of return types, rework constant naming in OpenPgpSignatureResult --- .../org/openintents/openpgp/util/OpenPgpApi.java | 23 +++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'openpgp-api/src/main/java/org/openintents/openpgp/util/OpenPgpApi.java') diff --git a/openpgp-api/src/main/java/org/openintents/openpgp/util/OpenPgpApi.java b/openpgp-api/src/main/java/org/openintents/openpgp/util/OpenPgpApi.java index 25bf72b..39e71ce 100644 --- a/openpgp-api/src/main/java/org/openintents/openpgp/util/OpenPgpApi.java +++ b/openpgp-api/src/main/java/org/openintents/openpgp/util/OpenPgpApi.java @@ -49,7 +49,7 @@ public class OpenPgpApi { * - Introduction of ACTION_DECRYPT_METADATA, RESULT_METADATA, EXTRA_ORIGINAL_FILENAME, and OpenPgpMetadata parcel * - Introduction of internal NFC extras: EXTRA_NFC_SIGNED_HASH, EXTRA_NFC_SIG_CREATION_TIMESTAMP * 5: - * - OpenPgpSignatureResult: new consts SIGNATURE_KEY_REVOKED and SIGNATURE_KEY_EXPIRED + * - OpenPgpSignatureResult: new consts RESULT_INVALID_KEY_REVOKED and RESULT_INVALID_KEY_EXPIRED * - OpenPgpSignatureResult: ArrayList userIds * 6: * - Deprecate ACTION_SIGN @@ -66,8 +66,14 @@ public class OpenPgpApi { * - New ACTION_GET_SIGN_KEY_ID * - EXTRA_PASSPHRASE changed from String to char[] * 8: - * - OpenPgpSignatureResult: new const INSECURE_CRYPTOGRAPHY - * - RESULT_TYPES important change: Introduce RESULT_TYPE_SIGNED_AND_ENCRYPTED, remove RESULT_TYPE_UNENCRYPTED_UNSIGNED + * - OpenPgpSignatureResult: + * method getStatus() renamed to getResult() + * constants have been renamed for clarity + * new constants: RESULT_NO_SIGNATURE, RESULT_INVALID_INSECURE + * isSignatureOnly() has been deprecated + * - RESULT_TYPES have been removed + * - new OpenPgpDecryptionResult returned via RESULT_DECRYPTION + * - OpenPgpSignatureResult and OpenPgpDecryptionResult are never null, they are always returned. */ public static final int API_VERSION = 8; @@ -164,7 +170,7 @@ public class OpenPgpApi { * and also signed-only input. * OutputStream is optional, e.g., for verifying detached signatures! *

- * If OpenPgpSignatureResult.getStatus() == OpenPgpSignatureResult.SIGNATURE_KEY_MISSING + * If OpenPgpSignatureResult.getResult() == OpenPgpSignatureResult.RESULT_KEY_MISSING * in addition a PendingIntent is returned via RESULT_INTENT to download missing keys. * On all other status, in addition a PendingIntent is returned via RESULT_INTENT to open * the key view in OpenKeychain. @@ -174,9 +180,9 @@ public class OpenPgpApi { *

* returned extras: * OpenPgpSignatureResult RESULT_SIGNATURE + * OpenPgpDecryptionResult RESULT_DECRYPTION * OpenPgpDecryptMetadata RESULT_METADATA * String RESULT_CHARSET (charset which was specified in the headers of ascii armored input, if any) - * int RESULT_TYPE */ public static final String ACTION_DECRYPT_VERIFY = "org.openintents.openpgp.action.DECRYPT_VERIFY"; @@ -273,16 +279,11 @@ public class OpenPgpApi { // DECRYPT_VERIFY public static final String EXTRA_DETACHED_SIGNATURE = "detached_signature"; public static final String RESULT_SIGNATURE = "signature"; + public static final String RESULT_DECRYPTION = "decryption"; public static final String RESULT_METADATA = "metadata"; // This will be the charset which was specified in the headers of ascii armored input, if any public static final String RESULT_CHARSET = "charset"; - // unencrypted _and_ unsigned content will return an ERROR as there is no OpenPGP data available - public static final String RESULT_TYPE = "type"; - public static final int RESULT_TYPE_ENCRYPTED = 1; - public static final int RESULT_TYPE_SIGNED = 2; - public static final int RESULT_TYPE_SIGNED_AND_ENCRYPTED = 3; - // INTERNAL, should not be used public static final String EXTRA_CALL_UUID1 = "call_uuid1"; public static final String EXTRA_CALL_UUID2 = "call_uuid2"; -- cgit v1.2.3