aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpHelper.java
diff options
context:
space:
mode:
authorDominik Schürmann <dominik@dominikschuermann.de>2014-04-11 20:23:46 +0200
committerDominik Schürmann <dominik@dominikschuermann.de>2014-04-11 20:23:46 +0200
commit12b8282d9b6b1723d8c4086911970d2f1188f53a (patch)
tree7a5f79581cef8bf68859d3cbb8d838b71a096583 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpHelper.java
parent89cf46bbd70422cb344ec75488bc15c7e7aa764d (diff)
downloadopen-keychain-12b8282d9b6b1723d8c4086911970d2f1188f53a.tar.gz
open-keychain-12b8282d9b6b1723d8c4086911970d2f1188f53a.tar.bz2
open-keychain-12b8282d9b6b1723d8c4086911970d2f1188f53a.zip
More ids removed
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpHelper.java')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpHelper.java41
1 files changed, 24 insertions, 17 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 ec2860593..9b505d2d9 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpHelper.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpHelper.java
@@ -48,8 +48,8 @@ public class PgpHelper {
public static final Pattern PGP_CLEARTEXT_SIGNATURE = Pattern
.compile(".*?(-----BEGIN PGP SIGNED MESSAGE-----.*?-----" +
- "BEGIN PGP SIGNATURE-----.*?-----END PGP SIGNATURE-----).*",
- Pattern.DOTALL);
+ "BEGIN PGP SIGNATURE-----.*?-----END PGP SIGNATURE-----).*",
+ Pattern.DOTALL);
public static final Pattern PGP_PUBLIC_KEY = Pattern.compile(
".*?(-----BEGIN PGP PUBLIC KEY BLOCK-----.*?-----END PGP PUBLIC KEY BLOCK-----).*",
@@ -71,21 +71,28 @@ public class PgpHelper {
return "OpenPGP Keychain v" + getVersion(context);
}
- public static int getStreamContent(Context context, InputStream inStream) throws IOException {
- InputStream in = PGPUtil.getDecoderStream(inStream);
- PGPObjectFactory pgpF = new PGPObjectFactory(in);
- Object object = pgpF.nextObject();
- while (object != null) {
- if (object instanceof PGPPublicKeyRing || object instanceof PGPSecretKeyRing) {
- return Id.content.keys;
- } else if (object instanceof PGPEncryptedDataList) {
- return Id.content.encrypted_data;
- }
- object = pgpF.nextObject();
- }
-
- return Id.content.unknown;
- }
+// public static final class content {
+// public static final int unknown = 0;
+// public static final int encrypted_data = 1;
+// public static final int keys = 2;
+// }
+//
+// public static int getStreamContent(Context context, InputStream inStream) throws IOException {
+//
+// InputStream in = PGPUtil.getDecoderStream(inStream);
+// PGPObjectFactory pgpF = new PGPObjectFactory(in);
+// Object object = pgpF.nextObject();
+// while (object != null) {
+// if (object instanceof PGPPublicKeyRing || object instanceof PGPSecretKeyRing) {
+// return Id.content.keys;
+// } else if (object instanceof PGPEncryptedDataList) {
+// return Id.content.encrypted_data;
+// }
+// object = pgpF.nextObject();
+// }
+//
+// return Id.content.unknown;
+// }
/**
* Generate a random filename