aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src
diff options
context:
space:
mode:
authormar-v-in <github@rvin.mooo.com>2014-06-24 01:31:06 +0200
committermar-v-in <github@rvin.mooo.com>2014-06-24 01:31:06 +0200
commitf039ef81aebcaed1f321baa7734d57b1e58ffb15 (patch)
tree5fc105fff8fd00fa3c6dc99544bce8f5d150e043 /OpenKeychain/src
parent9a7fc6d464dbcf8fb6c6fd1ca4df252f4e320f7c (diff)
downloadopen-keychain-f039ef81aebcaed1f321baa7734d57b1e58ffb15.tar.gz
open-keychain-f039ef81aebcaed1f321baa7734d57b1e58ffb15.tar.bz2
open-keychain-f039ef81aebcaed1f321baa7734d57b1e58ffb15.zip
Use URLEncoder instead of Uri.encode
Diffstat (limited to 'OpenKeychain/src')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/HkpKeyserver.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/HkpKeyserver.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/HkpKeyserver.java
index 2af69c3d9..56a5bc508 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/HkpKeyserver.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/HkpKeyserver.java
@@ -18,7 +18,6 @@
package org.sufficientlysecure.keychain.keyimport;
-import android.net.Uri;
import de.measite.minidns.Client;
import de.measite.minidns.Question;
import de.measite.minidns.Record;
@@ -332,7 +331,12 @@ public class HkpKeyserver extends Keyserver {
public void add(String armoredKey) throws AddKeyException {
try {
String query = getUrlPrefix() + mHost + ":" + mPort + "/pks/add";
- String params = "keytext=" + Uri.encode(armoredKey);
+ String params;
+ try {
+ params = "keytext=" + URLEncoder.encode(armoredKey, "utf8");
+ } catch (UnsupportedEncodingException e) {
+ throw new AddKeyException();
+ }
Log.d(Constants.TAG, "hkp keyserver add: " + query);
HttpURLConnection connection = openConnection(new URL(query));