mirror of
https://github.com/moparisthebest/open-keychain
synced 2025-02-07 10:30:14 -05:00
Cleanup of PgpConstants
This commit is contained in:
parent
afbb166de6
commit
02084ba14a
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user