token-import: add debug states for locked keys

This commit is contained in:
Vincent Breitmoser
2017-09-07 16:07:17 +02:00
parent 419dffab02
commit bdc855d618
2 changed files with 29 additions and 0 deletions

View File

@@ -67,4 +67,25 @@ public abstract class SecurityTokenInfo implements Parcelable {
new byte[20], new byte[20], Hex.decode("010203040506"),
"yubinu2@mugenguild.com", "http://valodim.stratum0.net/mryubinu2.asc", 3, 3);
}
public static SecurityTokenInfo newInstanceDebugLocked() {
if (!BuildConfig.DEBUG) {
throw new UnsupportedOperationException("This operation is only available in debug builds!");
}
return SecurityTokenInfo.create(
KeyFormattingUtils.convertFingerprintHexFingerprint("4700BA1AC417ABEF3CC7765AD686905837779C3E"),
new byte[20], new byte[20], Hex.decode("010203040506"),
"yubinu2@mugenguild.com", "http://valodim.stratum0.net/mryubinu2.asc", 0, 3);
}
public static SecurityTokenInfo newInstanceDebugLockedHard() {
if (!BuildConfig.DEBUG) {
throw new UnsupportedOperationException("This operation is only available in debug builds!");
}
return SecurityTokenInfo.create(
KeyFormattingUtils.convertFingerprintHexFingerprint("4700BA1AC417ABEF3CC7765AD686905837779C3E"),
new byte[20], new byte[20], Hex.decode("010203040506"),
"yubinu2@mugenguild.com", "http://valodim.stratum0.net/mryubinu2.asc", 0, 0);
}
}

View File

@@ -72,6 +72,14 @@ public class CreateSecurityTokenWaitFragment extends Fragment {
mCreateKeyActivity.loadFragment(ManageSecurityTokenFragment.newInstance(
SecurityTokenInfo.newInstanceDebugKeyserver()), FragAction.TO_RIGHT);
break;
case R.id.menu_token_debug_locked:
mCreateKeyActivity.loadFragment(ManageSecurityTokenFragment.newInstance(
SecurityTokenInfo.newInstanceDebugLocked()), FragAction.TO_RIGHT);
break;
case R.id.menu_token_debug_locked_hard:
mCreateKeyActivity.loadFragment(ManageSecurityTokenFragment.newInstance(
SecurityTokenInfo.newInstanceDebugLockedHard()), FragAction.TO_RIGHT);
break;
}
return super.onOptionsItemSelected(item);
}