aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain
diff options
context:
space:
mode:
authorDominik Schürmann <dominik@dominikschuermann.de>2015-03-05 17:53:14 +0100
committerDominik Schürmann <dominik@dominikschuermann.de>2015-03-05 17:53:14 +0100
commit02084ba14a5d1055dbb99d9f068b993310e0b517 (patch)
tree9922d27ad8094dd6a72bfa001632f2f638400a6f /OpenKeychain
parentafbb166de6ada76967cb671ba688445496cb24f8 (diff)
downloadopen-keychain-02084ba14a5d1055dbb99d9f068b993310e0b517.tar.gz
open-keychain-02084ba14a5d1055dbb99d9f068b993310e0b517.tar.bz2
open-keychain-02084ba14a5d1055dbb99d9f068b993310e0b517.zip
Cleanup of PgpConstants
Diffstat (limited to 'OpenKeychain')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpConstants.java46
1 files changed, 22 insertions, 24 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpConstants.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpConstants.java
index 6c0a9bd48..c0e254574 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpConstants.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpConstants.java
@@ -25,17 +25,9 @@ import java.util.LinkedList;
public class PgpConstants {
- public static interface OpenKeychainSymmetricKeyAlgorithmTags extends SymmetricKeyAlgorithmTags {
- public static final int USE_PREFERRED = -1;
- }
-
- public static interface OpenKeychainHashAlgorithmTags extends HashAlgorithmTags {
- public static final int USE_PREFERRED = -1;
- }
-
- public static interface OpenKeychainCompressionAlgorithmTags extends CompressionAlgorithmTags {
- public static final int USE_PREFERRED = -1;
- }
+ public static LinkedList<Integer> sPreferredSymmetricAlgorithms = new LinkedList<>();
+ public static LinkedList<Integer> sPreferredHashAlgorithms = new LinkedList<>();
+ public static LinkedList<Integer> sPreferredCompressionAlgorithms = new LinkedList<>();
/*
* Most preferred is first
@@ -45,11 +37,6 @@ public class PgpConstants {
* These lists also define the only algorithms which are used in OpenKeychain.
* We do not support algorithms such as MD5
*/
-
- public static LinkedList<Integer> sPreferredSymmetricAlgorithms = new LinkedList<>();
- public static LinkedList<Integer> sPreferredHashAlgorithms = new LinkedList<>();
- public static LinkedList<Integer> sPreferredCompressionAlgorithms = new LinkedList<>();
-
static {
sPreferredSymmetricAlgorithms.add(SymmetricKeyAlgorithmTags.AES_256);
sPreferredSymmetricAlgorithms.add(SymmetricKeyAlgorithmTags.AES_192);
@@ -69,14 +56,6 @@ public class PgpConstants {
sPreferredCompressionAlgorithms.add(CompressionAlgorithmTags.ZIP);
}
- public static int[] getAsArray(LinkedList<Integer> list) {
- int[] array = new int[list.size()];
- for (int i = 0; i < list.size(); i++) {
- array[i] = list.get(i); // Watch out for NullPointerExceptions!
- }
- return array;
- }
-
/*
* Note: s2kcount is a number between 0 and 0xff that controls the
* number of times to iterate the password hash before use. More
@@ -103,4 +82,23 @@ public class PgpConstants {
// see http://tools.ietf.org/html/rfc488 0#section-5.5.3
public static final int SECRET_KEY_SIGNATURE_CHECKSUM_HASH_ALGO = HashAlgorithmTags.SHA1;
+ public static interface OpenKeychainSymmetricKeyAlgorithmTags extends SymmetricKeyAlgorithmTags {
+ public static final int USE_PREFERRED = -1;
+ }
+
+ public static interface OpenKeychainHashAlgorithmTags extends HashAlgorithmTags {
+ public static final int USE_PREFERRED = -1;
+ }
+
+ public static interface OpenKeychainCompressionAlgorithmTags extends CompressionAlgorithmTags {
+ public static final int USE_PREFERRED = -1;
+ }
+
+ public static int[] getAsArray(LinkedList<Integer> list) {
+ int[] array = new int[list.size()];
+ for (int i = 0; i < list.size(); i++) {
+ array[i] = list.get(i);
+ }
+ return array;
+ }
}