aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp
diff options
context:
space:
mode:
authorVincent Breitmoser <valodim@mugenguild.com>2015-11-13 17:00:09 +0100
committerVincent Breitmoser <valodim@mugenguild.com>2015-11-13 17:00:09 +0100
commit712e526ab56649a252958818b2c1320f81e19142 (patch)
treed12a5183d70dc74b409bdbfc7d4c6d8aa80048f2 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp
parent2d7dada8880cff572a995009bc69a0b487b47265 (diff)
parent816dce0334e8b8d9da3cb00d31d26033b17040a3 (diff)
downloadopen-keychain-712e526ab56649a252958818b2c1320f81e19142.tar.gz
open-keychain-712e526ab56649a252958818b2c1320f81e19142.tar.bz2
open-keychain-712e526ab56649a252958818b2c1320f81e19142.zip
Merge commit '816dce0334e8b8d9da3cb00d31d26033b17040a3'
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpHelper.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpHelper.java
index e8d1d3111..fbda90775 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpHelper.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpHelper.java
@@ -117,7 +117,7 @@ public class PgpHelper {
}
}
- public static String getPgpContent(@NonNull CharSequence input) {
+ public static String getPgpMessageContent(@NonNull CharSequence input) {
Log.dEscaped(Constants.TAG, "input: " + input);
Matcher matcher = PgpHelper.PGP_MESSAGE.matcher(input);
@@ -141,4 +141,18 @@ public class PgpHelper {
}
}
+ public static String getPgpKeyContent(@NonNull CharSequence input) {
+ Log.dEscaped(Constants.TAG, "input: " + input);
+
+ Matcher matcher = PgpHelper.PGP_PUBLIC_KEY.matcher(input);
+ if (matcher.matches()) {
+ String text = matcher.group(1);
+ text = fixPgpMessage(text);
+
+ Log.dEscaped(Constants.TAG, "input fixed: " + text);
+ return text;
+ }
+ return null;
+ }
+
}