Make ECC 25519 the default generated key type
This commit is contained in:
committed by
Vincent Breitmoser
parent
5615197553
commit
0caeca0b66
@@ -180,13 +180,13 @@ public final class Constants {
|
||||
}
|
||||
|
||||
/**
|
||||
* Default key configuration: 3072 bit RSA (certify + sign, encrypt)
|
||||
* Default key configuration: EDDSA (certify + sign), Curve25519 ECDH (encrypt)
|
||||
*/
|
||||
public static void addDefaultSubkeys(SaveKeyringParcel.Builder builder) {
|
||||
builder.addSubkeyAdd(SubkeyAdd.createSubkeyAdd(SaveKeyringParcel.Algorithm.RSA,
|
||||
3072, null, KeyFlags.CERTIFY_OTHER | KeyFlags.SIGN_DATA, 0L));
|
||||
builder.addSubkeyAdd(SubkeyAdd.createSubkeyAdd(SaveKeyringParcel.Algorithm.RSA,
|
||||
3072, null, KeyFlags.ENCRYPT_COMMS | KeyFlags.ENCRYPT_STORAGE, 0L));
|
||||
builder.addSubkeyAdd(SubkeyAdd.createSubkeyAdd(SaveKeyringParcel.Algorithm.EDDSA,
|
||||
null, null, KeyFlags.CERTIFY_OTHER | KeyFlags.SIGN_DATA, 0L));
|
||||
builder.addSubkeyAdd(SubkeyAdd.createSubkeyAdd(SaveKeyringParcel.Algorithm.ECDH,
|
||||
null, SaveKeyringParcel.Curve.CV25519, KeyFlags.ENCRYPT_COMMS | KeyFlags.ENCRYPT_STORAGE, 0L));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -165,9 +165,8 @@ public class AddSubkeyDialogFragment extends DialogFragment {
|
||||
TwoLineArrayAdapter adapter = new TwoLineArrayAdapter(context,
|
||||
android.R.layout.simple_spinner_item, choices);
|
||||
mKeyTypeSpinner.setAdapter(adapter);
|
||||
// make RSA 3072 the default
|
||||
for (int i = 0; i < choices.size(); ++i) {
|
||||
if (choices.get(i).getId() == SupportedKeyType.RSA_3072) {
|
||||
if (choices.get(i).getId() == SupportedKeyType.ECC_25519) {
|
||||
mKeyTypeSpinner.setSelection(i);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user