From 5a24bb3428e89d394861d71bd50b46d941d6c875 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Wed, 6 May 2015 13:55:19 +0200 Subject: Pull from transifex --- .tx/config | 4 ++-- openpgp-api/src/main/res/values-de/strings.xml | 4 +++- openpgp-api/src/main/res/values-es/strings.xml | 2 ++ openpgp-api/src/main/res/values-fr/strings.xml | 2 ++ openpgp-api/src/main/res/values-ja/strings.xml | 2 ++ openpgp-api/src/main/res/values-nl/strings.xml | 7 ++++++- openpgp-api/src/main/res/values-pl/strings.xml | 5 ++++- openpgp-api/src/main/res/values-ru/strings.xml | 2 ++ openpgp-api/src/main/res/values-sl/strings.xml | 2 ++ openpgp-api/src/main/res/values-tr/strings.xml | 5 ++++- openpgp-api/src/main/res/values-zh/strings.xml | 5 ++++- 11 files changed, 33 insertions(+), 7 deletions(-) diff --git a/.tx/config b/.tx/config index 9e6de61..ab194a8 100644 --- a/.tx/config +++ b/.tx/config @@ -3,6 +3,6 @@ host = https://www.transifex.com lang_map = af_ZA: af-rZA, am_ET: am-rET, ar_AE: ar-rAE, ar_BH: ar-rBH, ar_DZ: ar-rDZ, ar_EG: ar-rEG, ar_IQ: ar-rIQ, ar_JO: ar-rJO, ar_KW: ar-rKW, ar_LB: ar-rLB, ar_LY: ar-rLY, ar_MA: ar-rMA, ar_OM: ar-rOM, ar_QA: ar-rQA, ar_SA: ar-rSA, ar_SY: ar-rSY, ar_TN: ar-rTN, ar_YE: ar-rYE, arn_CL: arn-rCL, as_IN: as-rIN, az_AZ: az-rAZ, ba_RU: ba-rRU, be_BY: be-rBY, bg_BG: bg-rBG, bn_BD: bn-rBD, bn_IN: bn-rIN, bo_CN: bo-rCN, br_FR: br-rFR, bs_BA: bs-rBA, ca_ES: ca-rES, co_FR: co-rFR, cs_CZ: cs-rCZ, cy_GB: cy-rGB, da_DK: da-rDK, de_AT: de-rAT, de_CH: de-rCH, de_DE: de-rDE, de_LI: de-rLI, de_LU: de-rLU, dsb_DE: dsb-rDE, dv_MV: dv-rMV, el_GR: el-rGR, en_AU: en-rAU, en_BZ: en-rBZ, en_CA: en-rCA, en_GB: en-rGB, en_IE: en-rIE, en_IN: en-rIN, en_JM: en-rJM, en_MY: en-rMY, en_NZ: en-rNZ, en_PH: en-rPH, en_SG: en-rSG, en_TT: en-rTT, en_US: en-rUS, en_ZA: en-rZA, en_ZW: en-rZW, es_AR: es-rAR, es_BO: es-rBO, es_CL: es-rCL, es_CO: es-rCO, es_CR: es-rCR, es_DO: es-rDO, es_EC: es-rEC, es_ES: es-rES, es_GT: es-rGT, es_HN: es-rHN, es_MX: es-rMX, es_NI: es-rNI, es_PA: es-rPA, es_PE: es-rPE, es_PR: es-rPR, es_PY: es-rPY, es_SV: es-rSV, es_US: es-rUS, es_UY: es-rUY, es_VE: es-rVE, et_EE: et-rEE, eu_ES: eu-rES, fa_IR: fa-rIR, fi_FI: fi-rFI, fil_PH: fil-rPH, fo_FO: fo-rFO, fr_BE: fr-rBE, fr_CA: fr-rCA, fr_CH: fr-rCH, fr_FR: fr-rFR, fr_LU: fr-rLU, fr_MC: fr-rMC, fy_NL: fy-rNL, ga_IE: ga-rIE, gd_GB: gd-rGB, gl_ES: gl-rES, gsw_FR: gsw-rFR, gu_IN: gu-rIN, ha_NG: ha-rNG, hi_IN: hi-rIN, hr_BA: hr-rBA, hr_HR: hr-rHR, hsb_DE: hsb-rDE, hu_HU: hu-rHU, hy_AM: hy-rAM, id_ID: id-rID, ig_NG: ig-rNG, ii_CN: ii-rCN, is_IS: is-rIS, it_CH: it-rCH, it_IT: it-rIT, iu_CA: iu-rCA, ja_JP: ja-rJP, ka_GE: ka-rGE, kk_KZ: kk-rKZ, kl_GL: kl-rGL, km_KH: km-rKH, kn_IN: kn-rIN, ko_KR: ko-rKR, kok_IN: kok-rIN, ky_KG: ky-rKG, lb_LU: lb-rLU, lo_LA: lo-rLA, lt_LT: lt-rLT, lv_LV: lv-rLV, mi_NZ: mi-rNZ, mk_MK: mk-rMK, ml_IN: ml-rIN, mn_CN: mn-rCN, mn_MN: mn-rMN, moh_CA: moh-rCA, mr_IN: mr-rIN, ms_BN: ms-rBN, ms_MY: ms-rMY, mt_MT: mt-rMT, nb_NO: nb-rNO, ne_NP: ne-rNP, nl_BE: nl-rBE, nl_NL: nl-rNL, nn_NO: nn-rNO, nso_ZA: nso-rZA, oc_FR: oc-rFR, or_IN: or-rIN, pa_IN: pa-rIN, pl_PL: pl-rPL, prs_AF: prs-rAF, ps_AF: ps-rAF, pt_BR: pt-rBR, pt_PT: pt-rPT, qut_GT: qut-rGT, quz_BO: quz-rBO, quz_EC: quz-rEC, quz_PE: quz-rPE, rm_CH: rm-rCH, ro_RO: ro-rRO, ru_RU: ru-rRU, rw_RW: rw-rRW, sa_IN: sa-rIN, sah_RU: sah-rRU, se_FI: se-rFI, se_NO: se-rNO, se_SE: se-rSE, si_LK: si-rLK, sk_SK: sk-rSK, sl_SI: sl-rSI, sma_NO: sma-rNO, sma_SE: sma-rSE, smj_NO: smj-rNO, smj_SE: smj-rSE, smn_FI: smn-rFI, sms_FI: sms-rFI, sq_AL: sq-rAL, sr_BA: sr-rBA, sr_CS: sr-rCS, sr_ME: sr-rME, sr_RS: sr-rRS, sv_FI: sv-rFI, sv_SE: sv-rSE, sw_KE: sw-rKE, syr_SY: syr-rSY, ta_IN: ta-rIN, te_IN: te-rIN, tg_TJ: tg-rTJ, th_TH: th-rTH, tk_TM: tk-rTM, tn_ZA: tn-rZA, tr_TR: tr-rTR, tt_RU: tt-rRU, tzm_DZ: tzm-rDZ, ug_CN: ug-rCN, uk_UA: uk-rUA, ur_PK: ur-rPK, uz_UZ: uz-rUZ, vi_VN: vi-rVN, wo_SN: wo-rSN, xh_ZA: xh-rZA, yo_NG: yo-rNG, zh_CN: zh-rCN, zh_HK: zh-rHK, zh_MO: zh-rMO, zh_SG: zh-rSG, zh_TW: zh-rTW, zu_ZA: zu-rZA, no_NO: no-rNO, he_IL: iw-rIL, he: iw [open-keychain.api-strings] -file_filter = res/values-/strings.xml -source_file = res/values/strings.xml +file_filter = openpgp-api/src/main/res/values-/strings.xml +source_file = openpgp-api/src/main/res/values/strings.xml source_lang = en diff --git a/openpgp-api/src/main/res/values-de/strings.xml b/openpgp-api/src/main/res/values-de/strings.xml index 91e800a..01574ed 100644 --- a/openpgp-api/src/main/res/values-de/strings.xml +++ b/openpgp-api/src/main/res/values-de/strings.xml @@ -1,5 +1,7 @@ Keine Auswahl - Installiere OpenKeychain mit %s + Installiere OpenKeychain über %s + Kein Schlüssel ausgewählt + Schlüssel wurde ausgewählt diff --git a/openpgp-api/src/main/res/values-es/strings.xml b/openpgp-api/src/main/res/values-es/strings.xml index da8979b..b83a6ca 100644 --- a/openpgp-api/src/main/res/values-es/strings.xml +++ b/openpgp-api/src/main/res/values-es/strings.xml @@ -2,4 +2,6 @@ Ninguno Instalar OpenKeychain mediante %s + No se seleccionó clave + Se ha seleccionado clave diff --git a/openpgp-api/src/main/res/values-fr/strings.xml b/openpgp-api/src/main/res/values-fr/strings.xml index 9b36df2..4792138 100644 --- a/openpgp-api/src/main/res/values-fr/strings.xml +++ b/openpgp-api/src/main/res/values-fr/strings.xml @@ -2,4 +2,6 @@ Aucun Installer OpenKeychain par %s + Aucune clef sélectionnée + La clef a été sélectionnée diff --git a/openpgp-api/src/main/res/values-ja/strings.xml b/openpgp-api/src/main/res/values-ja/strings.xml index 5e337f5..ab9ba21 100644 --- a/openpgp-api/src/main/res/values-ja/strings.xml +++ b/openpgp-api/src/main/res/values-ja/strings.xml @@ -2,4 +2,6 @@ 無し %s 経由でOpenKeychainをインストール + 鍵が選択されていません + 鍵は選択済みです diff --git a/openpgp-api/src/main/res/values-nl/strings.xml b/openpgp-api/src/main/res/values-nl/strings.xml index c757504..5093803 100644 --- a/openpgp-api/src/main/res/values-nl/strings.xml +++ b/openpgp-api/src/main/res/values-nl/strings.xml @@ -1,2 +1,7 @@ - + + Geen + Installeer OpenKeychain via %s + Geen sleutel geselecteerd + Sleutel is geselecteerd + diff --git a/openpgp-api/src/main/res/values-pl/strings.xml b/openpgp-api/src/main/res/values-pl/strings.xml index c757504..f42bfd0 100644 --- a/openpgp-api/src/main/res/values-pl/strings.xml +++ b/openpgp-api/src/main/res/values-pl/strings.xml @@ -1,2 +1,5 @@ - + + Brak + Instaluj OpenKeychain przez %s + diff --git a/openpgp-api/src/main/res/values-ru/strings.xml b/openpgp-api/src/main/res/values-ru/strings.xml index e8fd1dd..33e4277 100644 --- a/openpgp-api/src/main/res/values-ru/strings.xml +++ b/openpgp-api/src/main/res/values-ru/strings.xml @@ -2,4 +2,6 @@ Нет Установить OpenKeychain через %s + Ключ не выбран + Ключ был выбран diff --git a/openpgp-api/src/main/res/values-sl/strings.xml b/openpgp-api/src/main/res/values-sl/strings.xml index 20bf70b..74d4949 100644 --- a/openpgp-api/src/main/res/values-sl/strings.xml +++ b/openpgp-api/src/main/res/values-sl/strings.xml @@ -2,4 +2,6 @@ Brez Namesti OpenKeychain prek %s + Izbran ni noben ključ + Ključ je bil izbran diff --git a/openpgp-api/src/main/res/values-tr/strings.xml b/openpgp-api/src/main/res/values-tr/strings.xml index c757504..a5f518d 100644 --- a/openpgp-api/src/main/res/values-tr/strings.xml +++ b/openpgp-api/src/main/res/values-tr/strings.xml @@ -1,2 +1,5 @@ - + + Hiç + %s aracılığıyla OpenKeychain\'i yükle + diff --git a/openpgp-api/src/main/res/values-zh/strings.xml b/openpgp-api/src/main/res/values-zh/strings.xml index c757504..ce62ff0 100644 --- a/openpgp-api/src/main/res/values-zh/strings.xml +++ b/openpgp-api/src/main/res/values-zh/strings.xml @@ -1,2 +1,5 @@ - + + 尚未选择密钥 + 已经选中密钥 + -- cgit v1.2.3 From 550d134645765e45c6aa8a7a06d24cd93944bf85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Mon, 27 Jul 2015 19:40:33 +0200 Subject: Add INSECURE_CRYPTOGRAPHY to OpenPgpSignatureResult, increase API version to 8 --- .../main/java/org/openintents/openpgp/OpenPgpSignatureResult.java | 8 +++++--- .../src/main/java/org/openintents/openpgp/util/OpenPgpApi.java | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/openpgp-api/src/main/java/org/openintents/openpgp/OpenPgpSignatureResult.java b/openpgp-api/src/main/java/org/openintents/openpgp/OpenPgpSignatureResult.java index 6b5045d..c2461ab 100644 --- a/openpgp-api/src/main/java/org/openintents/openpgp/OpenPgpSignatureResult.java +++ b/openpgp-api/src/main/java/org/openintents/openpgp/OpenPgpSignatureResult.java @@ -35,7 +35,7 @@ public class OpenPgpSignatureResult implements Parcelable { */ public static final int PARCELABLE_VERSION = 2; - // generic error on signature verification + // error -> invalid signature! public static final int SIGNATURE_ERROR = 0; // successfully verified signature, with certified key public static final int SIGNATURE_SUCCESS_CERTIFIED = 1; @@ -43,10 +43,12 @@ public class OpenPgpSignatureResult implements Parcelable { public static final int SIGNATURE_KEY_MISSING = 2; // successfully verified signature, but with uncertified key public static final int SIGNATURE_SUCCESS_UNCERTIFIED = 3; - // key has been revoked + // key has been revoked -> invalid signature! public static final int SIGNATURE_KEY_REVOKED = 4; - // key is expired + // key is expired -> invalid signature! public static final int SIGNATURE_KEY_EXPIRED = 5; + // insecure cryptographic algorithms/protocol -> invalid signature! + public static final int INSECURE_CRYPTOGRAPHY = 6; int status; boolean signatureOnly; 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 cd1edc5..bd40dbe 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 @@ -65,8 +65,10 @@ public class OpenPgpApi { * - New result for ACTION_DECRYPT_VERIFY: RESULT_TYPE * - New ACTION_GET_SIGN_KEY_ID * - EXTRA_PASSPHRASE changed from String to char[] + * 8: + * - OpenPgpSignatureResult: new const INSECURE_CRYPTOGRAPHY */ - public static final int API_VERSION = 7; + public static final int API_VERSION = 8; /** * General extras -- cgit v1.2.3 From 1cc39524997a4f1be8bd0238ae819fda23353cbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Mon, 27 Jul 2015 19:41:10 +0200 Subject: Pull from transifex --- openpgp-api/src/main/res/values-ar/strings.xml | 2 ++ openpgp-api/src/main/res/values-bg/strings.xml | 2 ++ openpgp-api/src/main/res/values-eu/strings.xml | 7 +++++++ openpgp-api/src/main/res/values-ro/strings.xml | 2 ++ openpgp-api/src/main/res/values-sr/strings.xml | 7 +++++++ openpgp-api/src/main/res/values-sv/strings.xml | 5 +++++ openpgp-api/src/main/res/values-zh-rTW/strings.xml | 4 ++++ 7 files changed, 29 insertions(+) create mode 100644 openpgp-api/src/main/res/values-ar/strings.xml create mode 100644 openpgp-api/src/main/res/values-bg/strings.xml create mode 100644 openpgp-api/src/main/res/values-eu/strings.xml create mode 100644 openpgp-api/src/main/res/values-ro/strings.xml create mode 100644 openpgp-api/src/main/res/values-sr/strings.xml create mode 100644 openpgp-api/src/main/res/values-sv/strings.xml create mode 100644 openpgp-api/src/main/res/values-zh-rTW/strings.xml diff --git a/openpgp-api/src/main/res/values-ar/strings.xml b/openpgp-api/src/main/res/values-ar/strings.xml new file mode 100644 index 0000000..c757504 --- /dev/null +++ b/openpgp-api/src/main/res/values-ar/strings.xml @@ -0,0 +1,2 @@ + + diff --git a/openpgp-api/src/main/res/values-bg/strings.xml b/openpgp-api/src/main/res/values-bg/strings.xml new file mode 100644 index 0000000..c757504 --- /dev/null +++ b/openpgp-api/src/main/res/values-bg/strings.xml @@ -0,0 +1,2 @@ + + diff --git a/openpgp-api/src/main/res/values-eu/strings.xml b/openpgp-api/src/main/res/values-eu/strings.xml new file mode 100644 index 0000000..b143f9f --- /dev/null +++ b/openpgp-api/src/main/res/values-eu/strings.xml @@ -0,0 +1,7 @@ + + + Ezer ez + Ezarri OpenKeychain %s bidez + Ez da giltzarik hautatu + Giltza hautatu da + diff --git a/openpgp-api/src/main/res/values-ro/strings.xml b/openpgp-api/src/main/res/values-ro/strings.xml new file mode 100644 index 0000000..c757504 --- /dev/null +++ b/openpgp-api/src/main/res/values-ro/strings.xml @@ -0,0 +1,2 @@ + + diff --git a/openpgp-api/src/main/res/values-sr/strings.xml b/openpgp-api/src/main/res/values-sr/strings.xml new file mode 100644 index 0000000..4535f70 --- /dev/null +++ b/openpgp-api/src/main/res/values-sr/strings.xml @@ -0,0 +1,7 @@ + + + Ништа + Инсталирај Отворени кључарник преко %s + Није изабран кључ + Кључ је изабран + diff --git a/openpgp-api/src/main/res/values-sv/strings.xml b/openpgp-api/src/main/res/values-sv/strings.xml new file mode 100644 index 0000000..1efa961 --- /dev/null +++ b/openpgp-api/src/main/res/values-sv/strings.xml @@ -0,0 +1,5 @@ + + + Ingen + Installera OpenKeychain via %s + diff --git a/openpgp-api/src/main/res/values-zh-rTW/strings.xml b/openpgp-api/src/main/res/values-zh-rTW/strings.xml new file mode 100644 index 0000000..b911092 --- /dev/null +++ b/openpgp-api/src/main/res/values-zh-rTW/strings.xml @@ -0,0 +1,4 @@ + + + + -- cgit v1.2.3 From b5c0b1bd7b7822d344d33b91af761d24e681ddd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Mon, 27 Jul 2015 21:10:37 +0200 Subject: Change result types --- .../src/main/java/org/openintents/openpgp/util/OpenPgpApi.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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 bd40dbe..25bf72b 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 @@ -67,6 +67,7 @@ public class OpenPgpApi { * - 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 */ public static final int API_VERSION = 8; @@ -276,10 +277,11 @@ public class OpenPgpApi { // 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_UNENCRYPTED_UNSIGNED = 0; 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"; @@ -336,11 +338,6 @@ public class OpenPgpApi { /** * InputStream and OutputStreams are always closed after operating on them! - * - * @param data - * @param is - * @param os - * @return */ public Intent executeApi(Intent data, InputStream is, OutputStream os) { ParcelFileDescriptor input = null; -- cgit v1.2.3 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 --- .../openpgp/OpenPgpDecryptionResult.java | 108 +++++++++++++++++++++ .../java/org/openintents/openpgp/OpenPgpError.java | 6 +- .../org/openintents/openpgp/OpenPgpMetadata.java | 6 +- .../openpgp/OpenPgpSignatureResult.java | 54 ++++++----- .../org/openintents/openpgp/util/OpenPgpApi.java | 23 ++--- 5 files changed, 151 insertions(+), 46 deletions(-) create mode 100644 openpgp-api/src/main/java/org/openintents/openpgp/OpenPgpDecryptionResult.java diff --git a/openpgp-api/src/main/java/org/openintents/openpgp/OpenPgpDecryptionResult.java b/openpgp-api/src/main/java/org/openintents/openpgp/OpenPgpDecryptionResult.java new file mode 100644 index 0000000..2090b55 --- /dev/null +++ b/openpgp-api/src/main/java/org/openintents/openpgp/OpenPgpDecryptionResult.java @@ -0,0 +1,108 @@ +/* + * Copyright (C) 2015 Dominik Schürmann + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openintents.openpgp; + +import android.os.Parcel; +import android.os.Parcelable; + +public class OpenPgpDecryptionResult implements Parcelable { + /** + * Since there might be a case where new versions of the client using the library getting + * old versions of the protocol (and thus old versions of this class), we need a versioning + * system for the parcels sent between the clients and the providers. + */ + public static final int PARCELABLE_VERSION = 1; + + // content not encrypted + public static final int RESULT_NOT_ENCRYPTED = -1; + // insecure! + public static final int RESULT_INSECURE = 0; + // encrypted + public static final int RESULT_ENCRYPTED = 1; + + int result; + + public int getResult() { + return result; + } + + public void setResult(int result) { + this.result = result; + } + + public OpenPgpDecryptionResult() { + + } + + public OpenPgpDecryptionResult(int result) { + this.result = result; + } + + public OpenPgpDecryptionResult(OpenPgpDecryptionResult b) { + this.result = b.result; + } + + public int describeContents() { + return 0; + } + + public void writeToParcel(Parcel dest, int flags) { + /** + * NOTE: When adding fields in the process of updating this API, make sure to bump + * {@link #PARCELABLE_VERSION}. + */ + dest.writeInt(PARCELABLE_VERSION); + // Inject a placeholder that will store the parcel size from this point on + // (not including the size itself). + int sizePosition = dest.dataPosition(); + dest.writeInt(0); + int startPosition = dest.dataPosition(); + // version 1 + dest.writeInt(result); + // Go back and write the size + int parcelableSize = dest.dataPosition() - startPosition; + dest.setDataPosition(sizePosition); + dest.writeInt(parcelableSize); + dest.setDataPosition(startPosition + parcelableSize); + } + + public static final Creator CREATOR = new Creator() { + public OpenPgpDecryptionResult createFromParcel(final Parcel source) { + source.readInt(); // parcelableVersion + int parcelableSize = source.readInt(); + int startPosition = source.dataPosition(); + + OpenPgpDecryptionResult vr = new OpenPgpDecryptionResult(); + vr.result = source.readInt(); + + // skip over all fields added in future versions of this parcel + source.setDataPosition(startPosition + parcelableSize); + + return vr; + } + + public OpenPgpDecryptionResult[] newArray(final int size) { + return new OpenPgpDecryptionResult[size]; + } + }; + + @Override + public String toString() { + return "\nresult: " + result; + } + +} diff --git a/openpgp-api/src/main/java/org/openintents/openpgp/OpenPgpError.java b/openpgp-api/src/main/java/org/openintents/openpgp/OpenPgpError.java index ce8f21f..69c39fd 100644 --- a/openpgp-api/src/main/java/org/openintents/openpgp/OpenPgpError.java +++ b/openpgp-api/src/main/java/org/openintents/openpgp/OpenPgpError.java @@ -19,10 +19,6 @@ package org.openintents.openpgp; import android.os.Parcel; import android.os.Parcelable; -/** - * Parcelable versioning has been copied from Dashclock Widget - * https://code.google.com/p/dashclock/source/browse/api/src/main/java/com/google/android/apps/dashclock/api/ExtensionData.java - */ public class OpenPgpError implements Parcelable { /** * Since there might be a case where new versions of the client using the library getting @@ -97,7 +93,7 @@ public class OpenPgpError implements Parcelable { public static final Creator CREATOR = new Creator() { public OpenPgpError createFromParcel(final Parcel source) { - int parcelableVersion = source.readInt(); + source.readInt(); // parcelableVersion int parcelableSize = source.readInt(); int startPosition = source.dataPosition(); diff --git a/openpgp-api/src/main/java/org/openintents/openpgp/OpenPgpMetadata.java b/openpgp-api/src/main/java/org/openintents/openpgp/OpenPgpMetadata.java index d620a57..8b3a3bb 100644 --- a/openpgp-api/src/main/java/org/openintents/openpgp/OpenPgpMetadata.java +++ b/openpgp-api/src/main/java/org/openintents/openpgp/OpenPgpMetadata.java @@ -19,10 +19,6 @@ package org.openintents.openpgp; import android.os.Parcel; import android.os.Parcelable; -/** - * Parcelable versioning has been copied from Dashclock Widget - * https://code.google.com/p/dashclock/source/browse/api/src/main/java/com/google/android/apps/dashclock/api/ExtensionData.java - */ public class OpenPgpMetadata implements Parcelable { /** * Since there might be a case where new versions of the client using the library getting @@ -99,7 +95,7 @@ public class OpenPgpMetadata implements Parcelable { public static final Creator CREATOR = new Creator() { public OpenPgpMetadata createFromParcel(final Parcel source) { - int parcelableVersion = source.readInt(); + source.readInt(); // parcelableVersion int parcelableSize = source.readInt(); int startPosition = source.dataPosition(); diff --git a/openpgp-api/src/main/java/org/openintents/openpgp/OpenPgpSignatureResult.java b/openpgp-api/src/main/java/org/openintents/openpgp/OpenPgpSignatureResult.java index c2461ab..f188968 100644 --- a/openpgp-api/src/main/java/org/openintents/openpgp/OpenPgpSignatureResult.java +++ b/openpgp-api/src/main/java/org/openintents/openpgp/OpenPgpSignatureResult.java @@ -23,10 +23,6 @@ import org.openintents.openpgp.util.OpenPgpUtils; import java.util.ArrayList; -/** - * Parcelable versioning has been copied from Dashclock Widget - * https://code.google.com/p/dashclock/source/browse/api/src/main/java/com/google/android/apps/dashclock/api/ExtensionData.java - */ public class OpenPgpSignatureResult implements Parcelable { /** * Since there might be a case where new versions of the client using the library getting @@ -35,39 +31,47 @@ public class OpenPgpSignatureResult implements Parcelable { */ public static final int PARCELABLE_VERSION = 2; - // error -> invalid signature! - public static final int SIGNATURE_ERROR = 0; - // successfully verified signature, with certified key - public static final int SIGNATURE_SUCCESS_CERTIFIED = 1; + // content not signed + public static final int RESULT_NO_SIGNATURE = -1; + // invalid signature! + public static final int RESULT_INVALID_SIGNATURE = 0; + // successfully verified signature, with confirmed key + public static final int RESULT_VALID_CONFIRMED = 1; // no key was found for this signature verification - public static final int SIGNATURE_KEY_MISSING = 2; - // successfully verified signature, but with uncertified key - public static final int SIGNATURE_SUCCESS_UNCERTIFIED = 3; + public static final int RESULT_KEY_MISSING = 2; + // successfully verified signature, but with unconfirmed key + public static final int RESULT_VALID_UNCONFIRMED = 3; // key has been revoked -> invalid signature! - public static final int SIGNATURE_KEY_REVOKED = 4; + public static final int RESULT_INVALID_KEY_REVOKED = 4; // key is expired -> invalid signature! - public static final int SIGNATURE_KEY_EXPIRED = 5; + public static final int RESULT_INVALID_KEY_EXPIRED = 5; // insecure cryptographic algorithms/protocol -> invalid signature! - public static final int INSECURE_CRYPTOGRAPHY = 6; + public static final int RESULT_INVALID_INSECURE = 6; - int status; + int result; boolean signatureOnly; String primaryUserId; ArrayList userIds; long keyId; - public int getStatus() { - return status; + public int getResult() { + return result; } - public void setStatus(int status) { - this.status = status; + public void setResult(int result) { + this.result = result; } + /** + * @deprecated + */ public boolean isSignatureOnly() { return signatureOnly; } + /** + * @deprecated + */ public void setSignatureOnly(boolean signatureOnly) { this.signatureOnly = signatureOnly; } @@ -102,7 +106,7 @@ public class OpenPgpSignatureResult implements Parcelable { public OpenPgpSignatureResult(int signatureStatus, String signatureUserId, boolean signatureOnly, long keyId, ArrayList userIds) { - this.status = signatureStatus; + this.result = signatureStatus; this.signatureOnly = signatureOnly; this.primaryUserId = signatureUserId; this.keyId = keyId; @@ -110,7 +114,7 @@ public class OpenPgpSignatureResult implements Parcelable { } public OpenPgpSignatureResult(OpenPgpSignatureResult b) { - this.status = b.status; + this.result = b.result; this.primaryUserId = b.primaryUserId; this.signatureOnly = b.signatureOnly; this.keyId = b.keyId; @@ -133,7 +137,7 @@ public class OpenPgpSignatureResult implements Parcelable { dest.writeInt(0); int startPosition = dest.dataPosition(); // version 1 - dest.writeInt(status); + dest.writeInt(result); dest.writeByte((byte) (signatureOnly ? 1 : 0)); dest.writeString(primaryUserId); dest.writeLong(keyId); @@ -148,12 +152,12 @@ public class OpenPgpSignatureResult implements Parcelable { public static final Creator CREATOR = new Creator() { public OpenPgpSignatureResult createFromParcel(final Parcel source) { - int parcelableVersion = source.readInt(); + source.readInt(); // parcelableVersion int parcelableSize = source.readInt(); int startPosition = source.dataPosition(); OpenPgpSignatureResult vr = new OpenPgpSignatureResult(); - vr.status = source.readInt(); + vr.result = source.readInt(); vr.signatureOnly = source.readByte() == 1; vr.primaryUserId = source.readString(); vr.keyId = source.readLong(); @@ -173,7 +177,7 @@ public class OpenPgpSignatureResult implements Parcelable { @Override public String toString() { - String out = "\nstatus: " + status; + String out = "\nresult: " + result; out += "\nprimaryUserId: " + primaryUserId; out += "\nuserIds: " + userIds; out += "\nsignatureOnly: " + signatureOnly; 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