Re-enable move-to-card option, improve strings
This commit is contained in:
@@ -35,6 +35,7 @@ import android.view.ViewGroup;
|
|||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
|
|
||||||
|
import org.bouncycastle.bcpg.PublicKeyAlgorithmTags;
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
import org.sufficientlysecure.keychain.compatibility.DialogFragmentWorkaround;
|
import org.sufficientlysecure.keychain.compatibility.DialogFragmentWorkaround;
|
||||||
@@ -440,50 +441,45 @@ public class EditKeyFragment extends QueueingCryptoOperationFragment<SaveKeyring
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case EditSubkeyDialogFragment.MESSAGE_MOVE_KEY_TO_CARD: {
|
case EditSubkeyDialogFragment.MESSAGE_MOVE_KEY_TO_SECURITY_TOKEN: {
|
||||||
// TODO: enable later when Admin PIN handling is resolved
|
SecretKeyType secretKeyType = mSubkeysAdapter.getSecretKeyType(position);
|
||||||
Notify.create(getActivity(),
|
if (secretKeyType == SecretKeyType.DIVERT_TO_CARD ||
|
||||||
"This feature will be available in an upcoming OpenKeychain version.",
|
secretKeyType == SecretKeyType.GNU_DUMMY) {
|
||||||
Notify.Style.WARN).show();
|
Notify.create(getActivity(), R.string.edit_key_error_bad_security_token_stripped, Notify.Style.ERROR)
|
||||||
break;
|
.show();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// Activity activity = EditKeyFragment.this.getActivity();
|
int algorithm = mSubkeysAdapter.getAlgorithm(position);
|
||||||
// SecretKeyType secretKeyType = mSubkeysAdapter.getSecretKeyType(position);
|
if (algorithm != PublicKeyAlgorithmTags.RSA_GENERAL
|
||||||
// if (secretKeyType == SecretKeyType.DIVERT_TO_CARD ||
|
&& algorithm != PublicKeyAlgorithmTags.RSA_ENCRYPT
|
||||||
// secretKeyType == SecretKeyType.GNU_DUMMY) {
|
&& algorithm != PublicKeyAlgorithmTags.RSA_SIGN) {
|
||||||
// Notify.create(activity, R.string.edit_key_error_bad_nfc_stripped, Notify.Style.ERROR)
|
Notify.create(getActivity(), R.string.edit_key_error_bad_security_token_algo, Notify.Style.ERROR)
|
||||||
// .show((ViewGroup) activity.findViewById(R.id.import_snackbar));
|
.show();
|
||||||
// break;
|
break;
|
||||||
// }
|
}
|
||||||
// int algorithm = mSubkeysAdapter.getAlgorithm(position);
|
|
||||||
// // these are the PGP constants for RSA_GENERAL, RSA_ENCRYPT and RSA_SIGN
|
if (mSubkeysAdapter.getKeySize(position) != 2048) {
|
||||||
// if (algorithm != 1 && algorithm != 2 && algorithm != 3) {
|
Notify.create(getActivity(), R.string.edit_key_error_bad_security_token_size, Notify.Style.ERROR)
|
||||||
// Notify.create(activity, R.string.edit_key_error_bad_nfc_algo, Notify.Style.ERROR)
|
.show();
|
||||||
// .show((ViewGroup) activity.findViewById(R.id.import_snackbar));
|
break;
|
||||||
// break;
|
}
|
||||||
// }
|
|
||||||
// if (mSubkeysAdapter.getKeySize(position) != 2048) {
|
SubkeyChange change;
|
||||||
// Notify.create(activity, R.string.edit_key_error_bad_nfc_size, Notify.Style.ERROR)
|
change = mSaveKeyringParcel.getSubkeyChange(keyId);
|
||||||
// .show((ViewGroup) activity.findViewById(R.id.import_snackbar));
|
if (change == null) {
|
||||||
// break;
|
mSaveKeyringParcel.mChangeSubKeys.add(
|
||||||
// }
|
new SubkeyChange(keyId, false, true)
|
||||||
//
|
);
|
||||||
//
|
break;
|
||||||
// SubkeyChange change;
|
}
|
||||||
// change = mSaveKeyringParcel.getSubkeyChange(keyId);
|
// toggle
|
||||||
// if (change == null) {
|
change.mMoveKeyToSecurityToken = !change.mMoveKeyToSecurityToken;
|
||||||
// mSaveKeyringParcel.mChangeSubKeys.add(
|
if (change.mMoveKeyToSecurityToken && change.mDummyStrip) {
|
||||||
// new SubkeyChange(keyId, false, true)
|
// User had chosen to strip key, but now wants to divert it.
|
||||||
// );
|
change.mDummyStrip = false;
|
||||||
// break;
|
}
|
||||||
// }
|
break;
|
||||||
// // toggle
|
|
||||||
// change.mMoveKeyToSecurityToken = !change.mMoveKeyToSecurityToken;
|
|
||||||
// if (change.mMoveKeyToSecurityToken && change.mDummyStrip) {
|
|
||||||
// // User had chosen to strip key, but now wants to divert it.
|
|
||||||
// change.mDummyStrip = false;
|
|
||||||
// }
|
|
||||||
// break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
getLoaderManager().getLoader(LOADER_ID_SUBKEYS).forceLoad();
|
getLoaderManager().getLoader(LOADER_ID_SUBKEYS).forceLoad();
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ import android.widget.AdapterView;
|
|||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
import android.widget.ViewAnimator;
|
import android.widget.ViewAnimator;
|
||||||
|
|
||||||
|
import org.bouncycastle.bcpg.PublicKeyAlgorithmTags;
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
import org.sufficientlysecure.keychain.compatibility.DialogFragmentWorkaround;
|
import org.sufficientlysecure.keychain.compatibility.DialogFragmentWorkaround;
|
||||||
@@ -346,50 +347,45 @@ public class ViewKeyAdvSubkeysFragment extends LoaderFragment implements
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case EditSubkeyDialogFragment.MESSAGE_MOVE_KEY_TO_CARD: {
|
case EditSubkeyDialogFragment.MESSAGE_MOVE_KEY_TO_SECURITY_TOKEN: {
|
||||||
// TODO: enable later when Admin PIN handling is resolved
|
SecretKeyType secretKeyType = mSubkeysAdapter.getSecretKeyType(position);
|
||||||
Notify.create(getActivity(),
|
if (secretKeyType == SecretKeyType.DIVERT_TO_CARD ||
|
||||||
"This feature will be available in an upcoming OpenKeychain version.",
|
secretKeyType == SecretKeyType.GNU_DUMMY) {
|
||||||
Notify.Style.WARN).show();
|
Notify.create(getActivity(), R.string.edit_key_error_bad_security_token_stripped, Notify.Style.ERROR)
|
||||||
break;
|
.show();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// Activity activity = EditKeyFragment.this.getActivity();
|
int algorithm = mSubkeysAdapter.getAlgorithm(position);
|
||||||
// SecretKeyType secretKeyType = mSubkeysAdapter.getSecretKeyType(position);
|
if (algorithm != PublicKeyAlgorithmTags.RSA_GENERAL
|
||||||
// if (secretKeyType == SecretKeyType.DIVERT_TO_CARD ||
|
&& algorithm != PublicKeyAlgorithmTags.RSA_ENCRYPT
|
||||||
// secretKeyType == SecretKeyType.GNU_DUMMY) {
|
&& algorithm != PublicKeyAlgorithmTags.RSA_SIGN) {
|
||||||
// Notify.create(activity, R.string.edit_key_error_bad_nfc_stripped, Notify.Style.ERROR)
|
Notify.create(getActivity(), R.string.edit_key_error_bad_security_token_algo, Notify.Style.ERROR)
|
||||||
// .show((ViewGroup) activity.findViewById(R.id.import_snackbar));
|
.show();
|
||||||
// break;
|
break;
|
||||||
// }
|
}
|
||||||
// int algorithm = mSubkeysAdapter.getAlgorithm(position);
|
|
||||||
// // these are the PGP constants for RSA_GENERAL, RSA_ENCRYPT and RSA_SIGN
|
if (mSubkeysAdapter.getKeySize(position) != 2048) {
|
||||||
// if (algorithm != 1 && algorithm != 2 && algorithm != 3) {
|
Notify.create(getActivity(), R.string.edit_key_error_bad_security_token_size, Notify.Style.ERROR)
|
||||||
// Notify.create(activity, R.string.edit_key_error_bad_nfc_algo, Notify.Style.ERROR)
|
.show();
|
||||||
// .show((ViewGroup) activity.findViewById(R.id.import_snackbar));
|
break;
|
||||||
// break;
|
}
|
||||||
// }
|
|
||||||
// if (mSubkeysAdapter.getKeySize(position) != 2048) {
|
SubkeyChange change;
|
||||||
// Notify.create(activity, R.string.edit_key_error_bad_nfc_size, Notify.Style.ERROR)
|
change = mEditModeSaveKeyringParcel.getSubkeyChange(keyId);
|
||||||
// .show((ViewGroup) activity.findViewById(R.id.import_snackbar));
|
if (change == null) {
|
||||||
// break;
|
mEditModeSaveKeyringParcel.mChangeSubKeys.add(
|
||||||
// }
|
new SubkeyChange(keyId, false, true)
|
||||||
//
|
);
|
||||||
//
|
break;
|
||||||
// SubkeyChange change;
|
}
|
||||||
// change = mSaveKeyringParcel.getSubkeyChange(keyId);
|
// toggle
|
||||||
// if (change == null) {
|
change.mMoveKeyToSecurityToken = !change.mMoveKeyToSecurityToken;
|
||||||
// mSaveKeyringParcel.mChangeSubKeys.add(
|
if (change.mMoveKeyToSecurityToken && change.mDummyStrip) {
|
||||||
// new SubkeyChange(keyId, false, true)
|
// User had chosen to strip key, but now wants to divert it.
|
||||||
// );
|
change.mDummyStrip = false;
|
||||||
// break;
|
}
|
||||||
// }
|
break;
|
||||||
// // toggle
|
|
||||||
// change.mMoveKeyToSecurityToken = !change.mMoveKeyToSecurityToken;
|
|
||||||
// if (change.mMoveKeyToSecurityToken && change.mDummyStrip) {
|
|
||||||
// // User had chosen to strip key, but now wants to divert it.
|
|
||||||
// change.mDummyStrip = false;
|
|
||||||
// }
|
|
||||||
// break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
getLoaderManager().getLoader(LOADER_ID_SUBKEYS).forceLoad();
|
getLoaderManager().getLoader(LOADER_ID_SUBKEYS).forceLoad();
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public class EditSubkeyDialogFragment extends DialogFragment {
|
|||||||
public static final int MESSAGE_CHANGE_EXPIRY = 1;
|
public static final int MESSAGE_CHANGE_EXPIRY = 1;
|
||||||
public static final int MESSAGE_REVOKE = 2;
|
public static final int MESSAGE_REVOKE = 2;
|
||||||
public static final int MESSAGE_STRIP = 3;
|
public static final int MESSAGE_STRIP = 3;
|
||||||
public static final int MESSAGE_MOVE_KEY_TO_CARD = 4;
|
public static final int MESSAGE_MOVE_KEY_TO_SECURITY_TOKEN = 4;
|
||||||
public static final int SUBKEY_MENU_CHANGE_EXPIRY = 0;
|
public static final int SUBKEY_MENU_CHANGE_EXPIRY = 0;
|
||||||
public static final int SUBKEY_MENU_REVOKE_SUBKEY = 1;
|
public static final int SUBKEY_MENU_REVOKE_SUBKEY = 1;
|
||||||
public static final int SUBKEY_MENU_STRIP_SUBKEY = 2;
|
public static final int SUBKEY_MENU_STRIP_SUBKEY = 2;
|
||||||
@@ -82,7 +82,7 @@ public class EditSubkeyDialogFragment extends DialogFragment {
|
|||||||
showAlertDialog();
|
showAlertDialog();
|
||||||
break;
|
break;
|
||||||
case SUBKEY_MENU_MOVE_TO_SECURITY_TOKEN:
|
case SUBKEY_MENU_MOVE_TO_SECURITY_TOKEN:
|
||||||
sendMessageToHandler(MESSAGE_MOVE_KEY_TO_CARD, null);
|
sendMessageToHandler(MESSAGE_MOVE_KEY_TO_SECURITY_TOKEN, null);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -64,8 +64,8 @@ public class KeyFormattingUtils {
|
|||||||
String algorithmStr;
|
String algorithmStr;
|
||||||
|
|
||||||
switch (algorithm) {
|
switch (algorithm) {
|
||||||
case PublicKeyAlgorithmTags.RSA_ENCRYPT:
|
|
||||||
case PublicKeyAlgorithmTags.RSA_GENERAL:
|
case PublicKeyAlgorithmTags.RSA_GENERAL:
|
||||||
|
case PublicKeyAlgorithmTags.RSA_ENCRYPT:
|
||||||
case PublicKeyAlgorithmTags.RSA_SIGN: {
|
case PublicKeyAlgorithmTags.RSA_SIGN: {
|
||||||
algorithmStr = "RSA";
|
algorithmStr = "RSA";
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -762,7 +762,7 @@
|
|||||||
<string name="edit_key_error_add_subkey">"Add at least one subkey!"</string>
|
<string name="edit_key_error_add_subkey">"Add at least one subkey!"</string>
|
||||||
<string name="edit_key_error_bad_security_token_algo">"Algorithm not supported by Security Token!"</string>
|
<string name="edit_key_error_bad_security_token_algo">"Algorithm not supported by Security Token!"</string>
|
||||||
<string name="edit_key_error_bad_security_token_size">"Key size not supported by Security Token!"</string>
|
<string name="edit_key_error_bad_security_token_size">"Key size not supported by Security Token!"</string>
|
||||||
<string name="edit_key_error_bad_security_token_stripped">"Cannot move key to Security Token (either stripped or 'divert-to-card')!"</string>
|
<string name="edit_key_error_bad_security_token_stripped">"Cannot move key to Security Token (either stripped or already on Security Token)!"</string>
|
||||||
|
|
||||||
<!-- Create key -->
|
<!-- Create key -->
|
||||||
<string name="create_key_upload">"Synchronize with the Internet"</string>
|
<string name="create_key_upload">"Synchronize with the Internet"</string>
|
||||||
@@ -953,7 +953,7 @@
|
|||||||
<string name="msg_is_subkey_empty">"Marked secret subkey %s as available, with empty password"</string>
|
<string name="msg_is_subkey_empty">"Marked secret subkey %s as available, with empty password"</string>
|
||||||
<string name="msg_is_subkey_pin">"Marked secret subkey %s as available, with PIN"</string>
|
<string name="msg_is_subkey_pin">"Marked secret subkey %s as available, with PIN"</string>
|
||||||
<string name="msg_is_subkey_stripped">"Marked secret subkey %s as stripped"</string>
|
<string name="msg_is_subkey_stripped">"Marked secret subkey %s as stripped"</string>
|
||||||
<string name="msg_is_subkey_divert">"Marked secret subkey %s as 'divert-to-card'"</string>
|
<string name="msg_is_subkey_divert">"Marked secret subkey %s as key on Security Token"</string>
|
||||||
<string name="msg_is_success_identical">"Keyring contains no new data, nothing to do"</string>
|
<string name="msg_is_success_identical">"Keyring contains no new data, nothing to do"</string>
|
||||||
<string name="msg_is_success">"Successfully imported secret keyring"</string>
|
<string name="msg_is_success">"Successfully imported secret keyring"</string>
|
||||||
|
|
||||||
@@ -1062,9 +1062,9 @@
|
|||||||
|
|
||||||
<!-- modifySecretKeyRing -->
|
<!-- modifySecretKeyRing -->
|
||||||
<string name="msg_mr">"Modifying keyring %s"</string>
|
<string name="msg_mr">"Modifying keyring %s"</string>
|
||||||
<string name="msg_mf_divert">"Will divert to Security Token for crypto operations"</string>
|
<string name="msg_mf_divert">"Will use Security Token for crypto operations"</string>
|
||||||
<string name="msg_mf_error_divert_newsub">"Creation of new subkeys is not supported for 'divert-to-card' primary keys!"</string>
|
<string name="msg_mf_error_divert_newsub">"Creation of new subkeys is not supported for primary keys on Security Tokens!"</string>
|
||||||
<string name="msg_mf_error_divert_serial">"The serial number of a 'divert-to-card' key must be 16 bytes! This is a programming error, please file a bug report!"</string>
|
<string name="msg_mf_error_divert_serial">"The serial number of a key on Security Tokens must be 16 bytes! This is a programming error, please file a bug report!"</string>
|
||||||
<string name="msg_mf_error_encode">"Encoding exception!"</string>
|
<string name="msg_mf_error_encode">"Encoding exception!"</string>
|
||||||
<string name="msg_mf_error_fingerprint">"Actual key fingerprint does not match the expected one!"</string>
|
<string name="msg_mf_error_fingerprint">"Actual key fingerprint does not match the expected one!"</string>
|
||||||
<string name="msg_mf_error_keyid">"No key ID. This is an internal error, please file a bug report!"</string>
|
<string name="msg_mf_error_keyid">"No key ID. This is an internal error, please file a bug report!"</string>
|
||||||
@@ -1097,7 +1097,7 @@
|
|||||||
<string name="msg_mf_primary_new">"Generating new certificate for new primary user ID"</string>
|
<string name="msg_mf_primary_new">"Generating new certificate for new primary user ID"</string>
|
||||||
<string name="msg_mf_restricted_mode">"Changing to restricted operation mode"</string>
|
<string name="msg_mf_restricted_mode">"Changing to restricted operation mode"</string>
|
||||||
<string name="msg_mf_subkey_change">"Modifying subkey %s"</string>
|
<string name="msg_mf_subkey_change">"Modifying subkey %s"</string>
|
||||||
<string name="msg_mf_require_divert">"Diverting to Security Token for crypto operations"</string>
|
<string name="msg_mf_require_divert">"Using Security Token for crypto operations"</string>
|
||||||
<string name="msg_mf_require_passphrase">"Password required for operations"</string>
|
<string name="msg_mf_require_passphrase">"Password required for operations"</string>
|
||||||
<string name="msg_mf_subkey_new">"Adding new subkey of type %s"</string>
|
<string name="msg_mf_subkey_new">"Adding new subkey of type %s"</string>
|
||||||
<string name="msg_mf_subkey_new_id">"New subkey ID: %s"</string>
|
<string name="msg_mf_subkey_new_id">"New subkey ID: %s"</string>
|
||||||
@@ -1498,7 +1498,7 @@
|
|||||||
<string name="error_key_not_found">"Key not found!"</string>
|
<string name="error_key_not_found">"Key not found!"</string>
|
||||||
<string name="error_key_processing">"Error processing key!"</string>
|
<string name="error_key_processing">"Error processing key!"</string>
|
||||||
<string name="key_stripped">"stripped"</string>
|
<string name="key_stripped">"stripped"</string>
|
||||||
<string name="key_divert">"divert to Security Token"</string>
|
<string name="key_divert">"on Security Token"</string>
|
||||||
<string name="key_no_passphrase">"no password"</string>
|
<string name="key_no_passphrase">"no password"</string>
|
||||||
<string name="key_unavailable">"unavailable"</string>
|
<string name="key_unavailable">"unavailable"</string>
|
||||||
<string name="secret_cannot_multiple">"Your own keys can only be deleted individually!"</string>
|
<string name="secret_cannot_multiple">"Your own keys can only be deleted individually!"</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user