Merge pull request #344 from ankushb92/ankush2

#338
This commit is contained in:
Dominik Schürmann 2014-03-06 21:59:56 +01:00
commit 3d944483d3
28 changed files with 85 additions and 85 deletions

View file

@ -51,7 +51,7 @@ public final class Constants {
public static final String DEFAULT_ASCII_ARMOUR = "defaultAsciiArmour"; public static final String DEFAULT_ASCII_ARMOUR = "defaultAsciiArmour";
public static final String DEFAULT_MESSAGE_COMPRESSION = "defaultMessageCompression"; public static final String DEFAULT_MESSAGE_COMPRESSION = "defaultMessageCompression";
public static final String DEFAULT_FILE_COMPRESSION = "defaultFileCompression"; public static final String DEFAULT_FILE_COMPRESSION = "defaultFileCompression";
public static final String PASS_PHRASE_CACHE_TTL = "passPhraseCacheTtl"; public static final String PASS_PHRASE_CACHE_TTL = "passphraseCacheTtl";
public static final String LANGUAGE = "language"; public static final String LANGUAGE = "language";
public static final String FORCE_V3_SIGNATURES = "forceV3Signatures"; public static final String FORCE_V3_SIGNATURES = "forceV3Signatures";
public static final String KEY_SERVERS = "keyServers"; public static final String KEY_SERVERS = "keyServers";

View file

@ -30,7 +30,7 @@ public final class Id {
public static final class menu { public static final class menu {
public static final class option { public static final class option {
public static final int new_pass_phrase = 0x21070001; public static final int new_passphrase = 0x21070001;
public static final int create = 0x21070002; public static final int create = 0x21070002;
public static final int about = 0x21070003; public static final int about = 0x21070003;
public static final int manage_public_keys = 0x21070004; public static final int manage_public_keys = 0x21070004;
@ -85,12 +85,12 @@ public final class Id {
} }
public static final class dialog { public static final class dialog {
public static final int pass_phrase = 0x21070001; public static final int passphrase = 0x21070001;
public static final int encrypting = 0x21070002; public static final int encrypting = 0x21070002;
public static final int decrypting = 0x21070003; public static final int decrypting = 0x21070003;
public static final int new_pass_phrase = 0x21070004; public static final int new_passphrase = 0x21070004;
public static final int pass_phrases_do_not_match = 0x21070005; public static final int passphrases_do_not_match = 0x21070005;
public static final int no_pass_phrase = 0x21070006; public static final int no_passphrase = 0x21070006;
public static final int saving = 0x21070007; public static final int saving = 0x21070007;
public static final int delete_key = 0x21070008; public static final int delete_key = 0x21070008;
public static final int import_keys = 0x21070009; public static final int import_keys = 0x21070009;

View file

@ -90,8 +90,8 @@ public class PgpImportExport {
aos.write(keyring.getEncoded()); aos.write(keyring.getEncoded());
aos.close(); aos.close();
String armouredKey = bos.toString("UTF-8"); String armoredKey = bos.toString("UTF-8");
server.add(armouredKey); server.add(armoredKey);
return true; return true;
} catch (IOException e) { } catch (IOException e) {

View file

@ -107,7 +107,7 @@ public class PgpKeyOperation {
* *
* @param algorithmChoice * @param algorithmChoice
* @param keySize * @param keySize
* @param passPhrase * @param passphrase
* @param isMasterKey * @param isMasterKey
* @return * @return
* @throws NoSuchAlgorithmException * @throws NoSuchAlgorithmException
@ -118,7 +118,7 @@ public class PgpKeyOperation {
*/ */
// TODO: key flags? // TODO: key flags?
public PGPSecretKey createKey(int algorithmChoice, int keySize, String passPhrase, public PGPSecretKey createKey(int algorithmChoice, int keySize, String passphrase,
boolean isMasterKey) throws NoSuchAlgorithmException, PGPException, NoSuchProviderException, boolean isMasterKey) throws NoSuchAlgorithmException, PGPException, NoSuchProviderException,
PgpGeneralException, InvalidAlgorithmParameterException { PgpGeneralException, InvalidAlgorithmParameterException {
@ -126,8 +126,8 @@ public class PgpKeyOperation {
throw new PgpGeneralException(mContext.getString(R.string.error_key_size_minimum512bit)); throw new PgpGeneralException(mContext.getString(R.string.error_key_size_minimum512bit));
} }
if (passPhrase == null) { if (passphrase == null) {
passPhrase = ""; passphrase = "";
} }
int algorithm = 0; int algorithm = 0;
@ -181,7 +181,7 @@ public class PgpKeyOperation {
// Build key encrypter and decrypter based on passphrase // Build key encrypter and decrypter based on passphrase
PBESecretKeyEncryptor keyEncryptor = new JcePBESecretKeyEncryptorBuilder( PBESecretKeyEncryptor keyEncryptor = new JcePBESecretKeyEncryptorBuilder(
PGPEncryptedData.CAST5, sha1Calc) PGPEncryptedData.CAST5, sha1Calc)
.setProvider(Constants.BOUNCY_CASTLE_PROVIDER_NAME).build(passPhrase.toCharArray()); .setProvider(Constants.BOUNCY_CASTLE_PROVIDER_NAME).build(passphrase.toCharArray());
PGPSecretKey secKey = new PGPSecretKey(keyPair.getPrivateKey(), keyPair.getPublicKey(), PGPSecretKey secKey = new PGPSecretKey(keyPair.getPrivateKey(), keyPair.getPublicKey(),
sha1Calc, isMasterKey, keyEncryptor); sha1Calc, isMasterKey, keyEncryptor);

View file

@ -628,7 +628,7 @@ public class ProviderHelper {
String armoredKey = bos.toString("UTF-8"); String armoredKey = bos.toString("UTF-8");
Log.d(Constants.TAG, "armouredKey:" + armoredKey); Log.d(Constants.TAG, "armoredKey:" + armoredKey);
output.add(armoredKey); output.add(armoredKey);
} catch (IOException e) { } catch (IOException e) {

View file

@ -748,7 +748,7 @@ public class KeychainIntentService extends IntentService implements ProgressDial
*/ */
// need to have access to the bufferedInput, so we can reuse it for the possible // need to have access to the bufferedInput, so we can reuse it for the possible
// PGPObject chunks after the first one, e.g. files with several consecutive ASCII // PGPObject chunks after the first one, e.g. files with several consecutive ASCII
// armour blocks // armor blocks
BufferedInputStream bufferedInput = new BufferedInputStream(new ByteArrayInputStream(downloadedKey)); BufferedInputStream bufferedInput = new BufferedInputStream(new ByteArrayInputStream(downloadedKey));
try { try {

View file

@ -92,12 +92,12 @@ public class EditKeyActivity extends ActionBarActivity {
private SectionView mUserIdsView; private SectionView mUserIdsView;
private SectionView mKeysView; private SectionView mKeysView;
private String mCurrentPassPhrase = null; private String mCurrentPassphrase = null;
private String mNewPassPhrase = null; private String mNewPassPhrase = null;
private String mSavedNewPassPhrase = null; private String mSavedNewPassPhrase = null;
private boolean mIsPassPhraseSet; private boolean mIsPassPhraseSet;
private BootstrapButton mChangePassPhrase; private BootstrapButton mChangePassphrase;
private CheckBox mNoPassphrase; private CheckBox mNoPassphrase;
@ -150,7 +150,7 @@ public class EditKeyActivity extends ActionBarActivity {
Bundle extras = intent.getExtras(); Bundle extras = intent.getExtras();
mCurrentPassPhrase = ""; mCurrentPassphrase = "";
if (extras != null) { if (extras != null) {
// if userId is given, prefill the fields // if userId is given, prefill the fields
@ -165,7 +165,7 @@ public class EditKeyActivity extends ActionBarActivity {
if (noPassphrase) { if (noPassphrase) {
// check "no passphrase" checkbox and remove button // check "no passphrase" checkbox and remove button
mNoPassphrase.setChecked(true); mNoPassphrase.setChecked(true);
mChangePassPhrase.setVisibility(View.GONE); mChangePassphrase.setVisibility(View.GONE);
} }
} }
@ -181,7 +181,7 @@ public class EditKeyActivity extends ActionBarActivity {
// fill values for this action // fill values for this action
Bundle data = new Bundle(); Bundle data = new Bundle();
data.putString(KeychainIntentService.GENERATE_KEY_SYMMETRIC_PASSPHRASE, data.putString(KeychainIntentService.GENERATE_KEY_SYMMETRIC_PASSPHRASE,
mCurrentPassPhrase); mCurrentPassphrase);
serviceIntent.putExtra(KeychainIntentService.EXTRA_DATA, data); serviceIntent.putExtra(KeychainIntentService.EXTRA_DATA, data);
@ -281,9 +281,9 @@ public class EditKeyActivity extends ActionBarActivity {
@Override @Override
public void handleMessage(Message message) { public void handleMessage(Message message) {
if (message.what == PassphraseDialogFragment.MESSAGE_OKAY) { if (message.what == PassphraseDialogFragment.MESSAGE_OKAY) {
String passPhrase = PassphraseCacheService.getCachedPassphrase( String passphrase = PassphraseCacheService.getCachedPassphrase(
EditKeyActivity.this, masterKeyId); EditKeyActivity.this, masterKeyId);
mCurrentPassPhrase = passPhrase; mCurrentPassphrase = passphrase;
finallySaveClicked(); finallySaveClicked();
} }
} }
@ -373,14 +373,14 @@ public class EditKeyActivity extends ActionBarActivity {
} }
} }
mCurrentPassPhrase = ""; mCurrentPassphrase = "";
buildLayout(); buildLayout();
mIsPassPhraseSet = PassphraseCacheService.hasPassphrase(this, masterKeyId); mIsPassPhraseSet = PassphraseCacheService.hasPassphrase(this, masterKeyId);
if (!mIsPassPhraseSet) { if (!mIsPassPhraseSet) {
// check "no passphrase" checkbox and remove button // check "no passphrase" checkbox and remove button
mNoPassphrase.setChecked(true); mNoPassphrase.setChecked(true);
mChangePassPhrase.setVisibility(View.GONE); mChangePassphrase.setVisibility(View.GONE);
} }
} }
@ -410,7 +410,7 @@ public class EditKeyActivity extends ActionBarActivity {
// set title based on isPassphraseSet() // set title based on isPassphraseSet()
int title = -1; int title = -1;
if (isPassphraseSet()) { if (isPassphraseSet()) {
title = R.string.title_change_pass_phrase; title = R.string.title_change_passphrase;
} else { } else {
title = R.string.title_set_passphrase; title = R.string.title_set_passphrase;
} }
@ -429,7 +429,7 @@ public class EditKeyActivity extends ActionBarActivity {
setContentView(R.layout.edit_key_activity); setContentView(R.layout.edit_key_activity);
// find views // find views
mChangePassPhrase = (BootstrapButton) findViewById(R.id.edit_key_btn_change_pass_phrase); mChangePassphrase = (BootstrapButton) findViewById(R.id.edit_key_btn_change_passphrase);
mNoPassphrase = (CheckBox) findViewById(R.id.edit_key_no_passphrase); mNoPassphrase = (CheckBox) findViewById(R.id.edit_key_no_passphrase);
// Build layout based on given userIds and keys // Build layout based on given userIds and keys
@ -449,7 +449,7 @@ public class EditKeyActivity extends ActionBarActivity {
updatePassPhraseButtonText(); updatePassPhraseButtonText();
mChangePassPhrase.setOnClickListener(new OnClickListener() { mChangePassphrase.setOnClickListener(new OnClickListener() {
public void onClick(View v) { public void onClick(View v) {
showSetPassphraseDialog(); showSetPassphraseDialog();
} }
@ -464,10 +464,10 @@ public class EditKeyActivity extends ActionBarActivity {
// remove passphrase // remove passphrase
mSavedNewPassPhrase = mNewPassPhrase; mSavedNewPassPhrase = mNewPassPhrase;
mNewPassPhrase = ""; mNewPassPhrase = "";
mChangePassPhrase.setVisibility(View.GONE); mChangePassphrase.setVisibility(View.GONE);
} else { } else {
mNewPassPhrase = mSavedNewPassPhrase; mNewPassPhrase = mSavedNewPassPhrase;
mChangePassPhrase.setVisibility(View.VISIBLE); mChangePassphrase.setVisibility(View.VISIBLE);
} }
} }
}); });
@ -506,7 +506,7 @@ public class EditKeyActivity extends ActionBarActivity {
if (passphrase == null) { if (passphrase == null) {
showPassphraseDialog(masterKeyId, masterCanSign); showPassphraseDialog(masterKeyId, masterCanSign);
} else { } else {
mCurrentPassPhrase = passphrase; mCurrentPassphrase = passphrase;
finallySaveClicked(); finallySaveClicked();
} }
} catch (PgpGeneralException e) { } catch (PgpGeneralException e) {
@ -525,7 +525,7 @@ public class EditKeyActivity extends ActionBarActivity {
// fill values for this action // fill values for this action
Bundle data = new Bundle(); Bundle data = new Bundle();
data.putString(KeychainIntentService.SAVE_KEYRING_CURRENT_PASSPHRASE, data.putString(KeychainIntentService.SAVE_KEYRING_CURRENT_PASSPHRASE,
mCurrentPassPhrase); mCurrentPassphrase);
data.putString(KeychainIntentService.SAVE_KEYRING_NEW_PASSPHRASE, mNewPassPhrase); data.putString(KeychainIntentService.SAVE_KEYRING_NEW_PASSPHRASE, mNewPassPhrase);
data.putStringArrayList(KeychainIntentService.SAVE_KEYRING_USER_IDS, data.putStringArrayList(KeychainIntentService.SAVE_KEYRING_USER_IDS,
getUserIds(mUserIdsView)); getUserIds(mUserIdsView));
@ -696,7 +696,7 @@ public class EditKeyActivity extends ActionBarActivity {
} }
private void updatePassPhraseButtonText() { private void updatePassPhraseButtonText() {
mChangePassPhrase.setText(isPassphraseSet() ? getString(R.string.btn_change_passphrase) mChangePassphrase.setText(isPassphraseSet() ? getString(R.string.btn_change_passphrase)
: getString(R.string.btn_set_passphrase)); : getString(R.string.btn_set_passphrase));
} }

View file

@ -101,8 +101,8 @@ public class EncryptActivity extends DrawerActivity {
private int mEncryptTarget; private int mEncryptTarget;
private EditText mPassPhrase = null; private EditText mPassphrase = null;
private EditText mPassPhraseAgain = null; private EditText mPassphraseAgain = null;
private CheckBox mAsciiArmor = null; private CheckBox mAsciiArmor = null;
private Spinner mFileCompression = null; private Spinner mFileCompression = null;
@ -436,14 +436,14 @@ public class EncryptActivity extends DrawerActivity {
// symmetric encryption // symmetric encryption
if (mMode.getCurrentView().getId() == R.id.modeSymmetric) { if (mMode.getCurrentView().getId() == R.id.modeSymmetric) {
boolean gotPassPhrase = false; boolean gotPassPhrase = false;
String passPhrase = mPassPhrase.getText().toString(); String passphrase = mPassphrase.getText().toString();
String passPhraseAgain = mPassPhraseAgain.getText().toString(); String passphraseAgain = mPassphraseAgain.getText().toString();
if (!passPhrase.equals(passPhraseAgain)) { if (!passphrase.equals(passphraseAgain)) {
AppMsg.makeText(this, R.string.passphrases_do_not_match, AppMsg.STYLE_ALERT).show(); AppMsg.makeText(this, R.string.passphrases_do_not_match, AppMsg.STYLE_ALERT).show();
return; return;
} }
gotPassPhrase = (passPhrase.length() != 0); gotPassPhrase = (passphrase.length() != 0);
if (!gotPassPhrase) { if (!gotPassPhrase) {
AppMsg.makeText(this, R.string.passphrase_must_not_be_empty, AppMsg.STYLE_ALERT) AppMsg.makeText(this, R.string.passphrase_must_not_be_empty, AppMsg.STYLE_ALERT)
.show(); .show();
@ -550,11 +550,11 @@ public class EncryptActivity extends DrawerActivity {
if (mMode.getCurrentView().getId() == R.id.modeSymmetric) { if (mMode.getCurrentView().getId() == R.id.modeSymmetric) {
Log.d(Constants.TAG, "Symmetric encryption enabled!"); Log.d(Constants.TAG, "Symmetric encryption enabled!");
String passPhrase = mPassPhrase.getText().toString(); String passphrase = mPassphrase.getText().toString();
if (passPhrase.length() == 0) { if (passphrase.length() == 0) {
passPhrase = null; passphrase = null;
} }
data.putString(KeychainIntentService.GENERATE_KEY_SYMMETRIC_PASSPHRASE, passPhrase); data.putString(KeychainIntentService.GENERATE_KEY_SYMMETRIC_PASSPHRASE, passphrase);
} else { } else {
mSecretKeyIdToPass = mSecretKeyId; mSecretKeyIdToPass = mSecretKeyId;
encryptionKeyIds = mEncryptionKeyIds; encryptionKeyIds = mEncryptionKeyIds;
@ -766,8 +766,8 @@ public class EncryptActivity extends DrawerActivity {
mMainUserId = (TextView) findViewById(R.id.mainUserId); mMainUserId = (TextView) findViewById(R.id.mainUserId);
mMainUserIdRest = (TextView) findViewById(R.id.mainUserIdRest); mMainUserIdRest = (TextView) findViewById(R.id.mainUserIdRest);
mPassPhrase = (EditText) findViewById(R.id.passPhrase); mPassphrase = (EditText) findViewById(R.id.passphrase);
mPassPhraseAgain = (EditText) findViewById(R.id.passPhraseAgain); mPassphraseAgain = (EditText) findViewById(R.id.passphraseAgain);
// measure the height of the source_file view and set the message view's min height to that, // measure the height of the source_file view and set the message view's min height to that,
// so it fills mSource fully... bit of a hack. // so it fills mSource fully... bit of a hack.

View file

@ -255,14 +255,14 @@ public class PreferencesActivity extends PreferenceActivity {
|| super.isValidFragment(fragmentName); || super.isValidFragment(fragmentName);
} }
private static void initializePassPassPhraceCacheTtl(final IntegerListPreference mPassPhraseCacheTtl) { private static void initializePassPassPhraceCacheTtl(final IntegerListPreference mPassphraseCacheTtl) {
mPassPhraseCacheTtl.setValue("" + mPreferences.getPassPhraseCacheTtl()); mPassphraseCacheTtl.setValue("" + mPreferences.getPassPhraseCacheTtl());
mPassPhraseCacheTtl.setSummary(mPassPhraseCacheTtl.getEntry()); mPassphraseCacheTtl.setSummary(mPassphraseCacheTtl.getEntry());
mPassPhraseCacheTtl mPassphraseCacheTtl
.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { .setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
public boolean onPreferenceChange(Preference preference, Object newValue) { public boolean onPreferenceChange(Preference preference, Object newValue) {
mPassPhraseCacheTtl.setValue(newValue.toString()); mPassphraseCacheTtl.setValue(newValue.toString());
mPassPhraseCacheTtl.setSummary(mPassPhraseCacheTtl.getEntry()); mPassphraseCacheTtl.setSummary(mPassphraseCacheTtl.getEntry());
mPreferences.setPassPhraseCacheTtl(Integer.parseInt(newValue.toString())); mPreferences.setPassPhraseCacheTtl(Integer.parseInt(newValue.toString()));
return false; return false;
} }

View file

@ -97,7 +97,7 @@ public class ImportKeysListLoader extends AsyncTaskLoader<AsyncTaskResultWrapper
// need to have access to the bufferedInput, so we can reuse it for the possible // need to have access to the bufferedInput, so we can reuse it for the possible
// PGPObject chunks after the first one, e.g. files with several consecutive ASCII // PGPObject chunks after the first one, e.g. files with several consecutive ASCII
// armour blocks // armor blocks
BufferedInputStream bufferedInput = new BufferedInputStream(progressIn); BufferedInputStream bufferedInput = new BufferedInputStream(progressIn);
try { try {

View file

@ -153,7 +153,7 @@ public class PassphraseDialogFragment extends DialogFragment implements OnEditor
dismiss(); dismiss();
long curKeyIndex = 1; long curKeyIndex = 1;
boolean keyOK = true; boolean keyOK = true;
String passPhrase = mPassphraseEditText.getText().toString(); String passphrase = mPassphraseEditText.getText().toString();
long keyId; long keyId;
PGPSecretKey clickSecretKey = secretKey; PGPSecretKey clickSecretKey = secretKey;
@ -163,7 +163,7 @@ public class PassphraseDialogFragment extends DialogFragment implements OnEditor
try { try {
PBESecretKeyDecryptor keyDecryptor = new JcePBESecretKeyDecryptorBuilder() PBESecretKeyDecryptor keyDecryptor = new JcePBESecretKeyDecryptorBuilder()
.setProvider(Constants.BOUNCY_CASTLE_PROVIDER_NAME).build( .setProvider(Constants.BOUNCY_CASTLE_PROVIDER_NAME).build(
passPhrase.toCharArray()); passphrase.toCharArray());
PGPPrivateKey testKey = clickSecretKey PGPPrivateKey testKey = clickSecretKey
.extractPrivateKey(keyDecryptor); .extractPrivateKey(keyDecryptor);
if (testKey == null) { if (testKey == null) {
@ -206,10 +206,10 @@ public class PassphraseDialogFragment extends DialogFragment implements OnEditor
// cache the new passphrase // cache the new passphrase
Log.d(Constants.TAG, "Everything okay! Caching entered passphrase"); Log.d(Constants.TAG, "Everything okay! Caching entered passphrase");
PassphraseCacheService.addCachedPassphrase(activity, keyId, passPhrase); PassphraseCacheService.addCachedPassphrase(activity, keyId, passphrase);
if (keyOK == false && clickSecretKey.getKeyID() != keyId) { if (keyOK == false && clickSecretKey.getKeyID() != keyId) {
PassphraseCacheService.addCachedPassphrase(activity, clickSecretKey.getKeyID(), PassphraseCacheService.addCachedPassphrase(activity, clickSecretKey.getKeyID(),
passPhrase); passphrase);
} }
sendMessageToHandler(MESSAGE_OKAY); sendMessageToHandler(MESSAGE_OKAY);

View file

@ -101,9 +101,9 @@ public class SetPassphraseDialogFragment extends DialogFragment implements OnEdi
public void onClick(DialogInterface dialog, int id) { public void onClick(DialogInterface dialog, int id) {
dismiss(); dismiss();
String passPhrase1 = mPassphraseEditText.getText().toString(); String passphrase1 = mPassphraseEditText.getText().toString();
String passPhrase2 = mPassphraseAgainEditText.getText().toString(); String passphrase2 = mPassphraseAgainEditText.getText().toString();
if (!passPhrase1.equals(passPhrase2)) { if (!passphrase1.equals(passphrase2)) {
Toast.makeText( Toast.makeText(
activity, activity,
getString(R.string.error_message, getString(R.string.error_message,
@ -112,7 +112,7 @@ public class SetPassphraseDialogFragment extends DialogFragment implements OnEdi
return; return;
} }
if (passPhrase1.equals("")) { if (passphrase1.equals("")) {
Toast.makeText( Toast.makeText(
activity, activity,
getString(R.string.error_message, getString(R.string.error_message,
@ -123,7 +123,7 @@ public class SetPassphraseDialogFragment extends DialogFragment implements OnEdi
// return resulting data back to activity // return resulting data back to activity
Bundle data = new Bundle(); Bundle data = new Bundle();
data.putString(MESSAGE_NEW_PASSPHRASE, passPhrase1); data.putString(MESSAGE_NEW_PASSPHRASE, passphrase1);
sendMessageToHandler(MESSAGE_OKAY, data); sendMessageToHandler(MESSAGE_OKAY, data);
} }

View file

@ -220,18 +220,18 @@ public class SectionView extends LinearLayout implements OnClickListener, Editor
Bundle data = new Bundle(); Bundle data = new Bundle();
Boolean isMasterKey; Boolean isMasterKey;
String passPhrase; String passphrase;
if (mEditors.getChildCount() > 0) { if (mEditors.getChildCount() > 0) {
PGPSecretKey masterKey = ((KeyEditor) mEditors.getChildAt(0)).getValue(); PGPSecretKey masterKey = ((KeyEditor) mEditors.getChildAt(0)).getValue();
passPhrase = PassphraseCacheService passphrase = PassphraseCacheService
.getCachedPassphrase(mActivity, masterKey.getKeyID()); .getCachedPassphrase(mActivity, masterKey.getKeyID());
isMasterKey = false; isMasterKey = false;
} else { } else {
passPhrase = ""; passphrase = "";
isMasterKey = true; isMasterKey = true;
} }
data.putBoolean(KeychainIntentService.GENERATE_KEY_MASTER_KEY, isMasterKey); data.putBoolean(KeychainIntentService.GENERATE_KEY_MASTER_KEY, isMasterKey);
data.putString(KeychainIntentService.GENERATE_KEY_SYMMETRIC_PASSPHRASE, passPhrase); data.putString(KeychainIntentService.GENERATE_KEY_SYMMETRIC_PASSPHRASE, passphrase);
data.putInt(KeychainIntentService.GENERATE_KEY_ALGORITHM, mNewKeyAlgorithmChoice.getId()); data.putInt(KeychainIntentService.GENERATE_KEY_ALGORITHM, mNewKeyAlgorithmChoice.getId());
data.putInt(KeychainIntentService.GENERATE_KEY_KEY_SIZE, mNewKeySize); data.putInt(KeychainIntentService.GENERATE_KEY_KEY_SIZE, mNewKeySize);

View file

@ -48,5 +48,5 @@ public abstract class KeyServer {
abstract String get(long keyId) throws QueryException; abstract String get(long keyId) throws QueryException;
abstract void add(String armouredText) throws AddKeyException; abstract void add(String armoredText) throws AddKeyException;
} }

View file

@ -27,7 +27,7 @@
android:text="@string/label_no_passphrase" /> android:text="@string/label_no_passphrase" />
<com.beardedhen.androidbootstrap.BootstrapButton <com.beardedhen.androidbootstrap.BootstrapButton
android:id="@+id/edit_key_btn_change_pass_phrase" android:id="@+id/edit_key_btn_change_passphrase"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="60dp" android:layout_height="60dp"
android:padding="4dp" android:padding="4dp"

View file

@ -135,7 +135,7 @@
<TableRow> <TableRow>
<TextView <TextView
android:id="@+id/label_passPhrase" android:id="@+id/label_passphrase"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
@ -144,7 +144,7 @@
android:textAppearance="?android:attr/textAppearanceMedium" /> android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText <EditText
android:id="@+id/passPhrase" android:id="@+id/passphrase"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:inputType="textPassword" /> android:inputType="textPassword" />
@ -153,7 +153,7 @@
<TableRow> <TableRow>
<TextView <TextView
android:id="@+id/label_passPhraseAgain" android:id="@+id/label_passphraseAgain"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
@ -162,7 +162,7 @@
android:textAppearance="?android:attr/textAppearanceMedium" /> android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText <EditText
android:id="@+id/passPhraseAgain" android:id="@+id/passphraseAgain"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:inputType="textPassword" /> android:inputType="textPassword" />

View file

@ -13,7 +13,7 @@
<string name="title_preferences">Einstellungen</string> <string name="title_preferences">Einstellungen</string>
<string name="title_api_registered_apps">Registrierte Anwendungen</string> <string name="title_api_registered_apps">Registrierte Anwendungen</string>
<string name="title_key_server_preference">Schlüsselserver</string> <string name="title_key_server_preference">Schlüsselserver</string>
<string name="title_change_pass_phrase">Passwort ändern</string> <string name="title_change_passphrase">Passwort ändern</string>
<string name="title_set_passphrase">Passwort setzen</string> <string name="title_set_passphrase">Passwort setzen</string>
<string name="title_send_email">E-Mail senden…</string> <string name="title_send_email">E-Mail senden…</string>
<string name="title_encrypt_to_file">In eine Datei verschlüsseln</string> <string name="title_encrypt_to_file">In eine Datei verschlüsseln</string>

View file

@ -10,7 +10,7 @@
<string name="title_edit_key">Editar clave</string> <string name="title_edit_key">Editar clave</string>
<string name="title_preferences">Preferencias</string> <string name="title_preferences">Preferencias</string>
<string name="title_api_registered_apps">Aplicaciones registradas</string> <string name="title_api_registered_apps">Aplicaciones registradas</string>
<string name="title_change_pass_phrase">Cambiar contraseña</string> <string name="title_change_passphrase">Cambiar contraseña</string>
<string name="title_set_passphrase">Establecer contraseña</string> <string name="title_set_passphrase">Establecer contraseña</string>
<string name="title_send_email">Enviar correo electrónico…</string> <string name="title_send_email">Enviar correo electrónico…</string>
<string name="title_encrypt_to_file">Cifrar a archivo</string> <string name="title_encrypt_to_file">Cifrar a archivo</string>

View file

@ -13,7 +13,7 @@
<string name="title_preferences"> Preferencias</string> <string name="title_preferences"> Preferencias</string>
<string name="title_api_registered_apps">Aplicaciones registradas</string> <string name="title_api_registered_apps">Aplicaciones registradas</string>
<string name="title_key_server_preference">Prioridad del servidor de claves</string> <string name="title_key_server_preference">Prioridad del servidor de claves</string>
<string name="title_change_pass_phrase">Cambiar la frase de contraseña</string> <string name="title_change_passphrase">Cambiar la frase de contraseña</string>
<string name="title_set_passphrase">Establecer frase de contraseña</string> <string name="title_set_passphrase">Establecer frase de contraseña</string>
<string name="title_send_email">Enviar email…</string> <string name="title_send_email">Enviar email…</string>
<string name="title_encrypt_to_file">Cifrar hacia archivo</string> <string name="title_encrypt_to_file">Cifrar hacia archivo</string>

View file

@ -13,7 +13,7 @@
<string name="title_preferences">Préférences</string> <string name="title_preferences">Préférences</string>
<string name="title_api_registered_apps">Applications enregistrées</string> <string name="title_api_registered_apps">Applications enregistrées</string>
<string name="title_key_server_preference">Préférences du serveur de clefs</string> <string name="title_key_server_preference">Préférences du serveur de clefs</string>
<string name="title_change_pass_phrase">Changer la phrase de passe</string> <string name="title_change_passphrase">Changer la phrase de passe</string>
<string name="title_set_passphrase">Définir la phrase de passe</string> <string name="title_set_passphrase">Définir la phrase de passe</string>
<string name="title_send_email">Envoyer un courriel…</string> <string name="title_send_email">Envoyer un courriel…</string>
<string name="title_encrypt_to_file">Chiffrer vers un fichier</string> <string name="title_encrypt_to_file">Chiffrer vers un fichier</string>

View file

@ -13,7 +13,7 @@
<string name="title_preferences">Preferenze</string> <string name="title_preferences">Preferenze</string>
<string name="title_api_registered_apps">App Registrate</string> <string name="title_api_registered_apps">App Registrate</string>
<string name="title_key_server_preference">Preferenze Server delle Chiavi</string> <string name="title_key_server_preference">Preferenze Server delle Chiavi</string>
<string name="title_change_pass_phrase">Cambia Frase di Accesso</string> <string name="title_change_passphrase">Cambia Frase di Accesso</string>
<string name="title_set_passphrase">Imposta Frase di Accesso</string> <string name="title_set_passphrase">Imposta Frase di Accesso</string>
<string name="title_send_email">Invia Mail…</string> <string name="title_send_email">Invia Mail…</string>
<string name="title_encrypt_to_file">Codifica File</string> <string name="title_encrypt_to_file">Codifica File</string>

View file

@ -13,7 +13,7 @@
<string name="title_preferences">設定</string> <string name="title_preferences">設定</string>
<string name="title_api_registered_apps">登録済みのアプリケーション</string> <string name="title_api_registered_apps">登録済みのアプリケーション</string>
<string name="title_key_server_preference">鍵サーバ設定</string> <string name="title_key_server_preference">鍵サーバ設定</string>
<string name="title_change_pass_phrase">パスフレーズの変更</string> <string name="title_change_passphrase">パスフレーズの変更</string>
<string name="title_set_passphrase">パスフレーズの設定</string> <string name="title_set_passphrase">パスフレーズの設定</string>
<string name="title_send_email">メールの送信…</string> <string name="title_send_email">メールの送信…</string>
<string name="title_encrypt_to_file">暗号化してファイルに</string> <string name="title_encrypt_to_file">暗号化してファイルに</string>

View file

@ -10,7 +10,7 @@
<string name="title_edit_key">Sleutel bewerken</string> <string name="title_edit_key">Sleutel bewerken</string>
<string name="title_preferences">Instellingen</string> <string name="title_preferences">Instellingen</string>
<string name="title_api_registered_apps">Geregistreerde apps</string> <string name="title_api_registered_apps">Geregistreerde apps</string>
<string name="title_change_pass_phrase">Wachtwoord wijzigen</string> <string name="title_change_passphrase">Wachtwoord wijzigen</string>
<string name="title_set_passphrase">Wachtwoord instellen</string> <string name="title_set_passphrase">Wachtwoord instellen</string>
<string name="title_send_email">E-mail verzenden…</string> <string name="title_send_email">E-mail verzenden…</string>
<string name="title_encrypt_to_file">Versleutelen naar bestand</string> <string name="title_encrypt_to_file">Versleutelen naar bestand</string>

View file

@ -13,7 +13,7 @@
<string name="title_preferences">Настройки</string> <string name="title_preferences">Настройки</string>
<string name="title_api_registered_apps">Связанные приложения</string> <string name="title_api_registered_apps">Связанные приложения</string>
<string name="title_key_server_preference">Настройки сервера ключей</string> <string name="title_key_server_preference">Настройки сервера ключей</string>
<string name="title_change_pass_phrase">Изменить пароль</string> <string name="title_change_passphrase">Изменить пароль</string>
<string name="title_set_passphrase">Задать пароль</string> <string name="title_set_passphrase">Задать пароль</string>
<string name="title_send_email">Отправить…</string> <string name="title_send_email">Отправить…</string>
<string name="title_encrypt_to_file">Зашифровать в файл</string> <string name="title_encrypt_to_file">Зашифровать в файл</string>

View file

@ -13,7 +13,7 @@
<string name="title_preferences">Налаштування</string> <string name="title_preferences">Налаштування</string>
<string name="title_api_registered_apps">Зареєстровані програми</string> <string name="title_api_registered_apps">Зареєстровані програми</string>
<string name="title_key_server_preference">Налаштування сервера ключів</string> <string name="title_key_server_preference">Налаштування сервера ключів</string>
<string name="title_change_pass_phrase">Змінити парольну фразу</string> <string name="title_change_passphrase">Змінити парольну фразу</string>
<string name="title_set_passphrase">Задати парольну фразу</string> <string name="title_set_passphrase">Задати парольну фразу</string>
<string name="title_send_email">Надіслати листа…</string> <string name="title_send_email">Надіслати листа…</string>
<string name="title_encrypt_to_file">Зашифрувати до файлу</string> <string name="title_encrypt_to_file">Зашифрувати до файлу</string>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string-array name="pass_phrase_cache_ttl_entries" translatable="false"> <string-array name="passphrase_cache_ttl_entries" translatable="false">
<item>@string/choice_15secs</item> <item>@string/choice_15secs</item>
<item>@string/choice_1min</item> <item>@string/choice_1min</item>
<item>@string/choice_3mins</item> <item>@string/choice_3mins</item>
@ -15,7 +15,7 @@
<item>@string/choice_8hours</item> <item>@string/choice_8hours</item>
<item>@string/choice_forever</item> <item>@string/choice_forever</item>
</string-array> </string-array>
<string-array name="pass_phrase_cache_ttl_values" translatable="false"> <string-array name="passphrase_cache_ttl_values" translatable="false">
<item>15</item> <item>15</item>
<item>60</item> <item>60</item>
<item>180</item> <item>180</item>

View file

@ -14,7 +14,7 @@
<string name="title_preferences">Preferences</string> <string name="title_preferences">Preferences</string>
<string name="title_api_registered_apps">Registered Applications</string> <string name="title_api_registered_apps">Registered Applications</string>
<string name="title_key_server_preference">Keyserver Preference</string> <string name="title_key_server_preference">Keyserver Preference</string>
<string name="title_change_pass_phrase">Change Passphrase</string> <string name="title_change_passphrase">Change Passphrase</string>
<string name="title_set_passphrase">Set Passphrase</string> <string name="title_set_passphrase">Set Passphrase</string>
<string name="title_send_email">"Send Mail…"</string> <string name="title_send_email">"Send Mail…"</string>
<string name="title_encrypt_to_file">Encrypt To File</string> <string name="title_encrypt_to_file">Encrypt To File</string>

View file

@ -18,9 +18,9 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory android:title="@string/section_general" > <PreferenceCategory android:title="@string/section_general" >
<org.sufficientlysecure.keychain.ui.widget.IntegerListPreference <org.sufficientlysecure.keychain.ui.widget.IntegerListPreference
android:entries="@array/pass_phrase_cache_ttl_entries" android:entries="@array/passphrase_cache_ttl_entries"
android:entryValues="@array/pass_phrase_cache_ttl_values" android:entryValues="@array/passphrase_cache_ttl_values"
android:key="passPhraseCacheTtl" android:key="passphraseCacheTtl"
android:persistent="false" android:persistent="false"
android:title="@string/label_passphrase_cache_ttl" /> android:title="@string/label_passphrase_cache_ttl" />