import file default for keys is empty now, changed import text a little, and changing the pass phrase during key editing updates the pass phrase cache

This commit is contained in:
Thialfihar 2010-05-19 14:51:58 +00:00
parent 5b28bbdee2
commit f424b7f581
7 changed files with 41 additions and 7 deletions

View File

@ -42,6 +42,7 @@
<!-- section_lowerCase: capitalized words, no punctuation --> <!-- section_lowerCase: capitalized words, no punctuation -->
<string name="section_userIds">User IDs</string> <string name="section_userIds">User IDs</string>
<string name="section_keys">Keys</string> <string name="section_keys">Keys</string>
<string name="section_general">General</string>
<string name="section_defaults">Defaults</string> <string name="section_defaults">Defaults</string>
<!-- btn_lowerCase: capitalized words, no punctuation --> <!-- btn_lowerCase: capitalized words, no punctuation -->
@ -92,6 +93,9 @@
<string name="label_hashAlgorithm">Hash Algorithm</string> <string name="label_hashAlgorithm">Hash Algorithm</string>
<string name="label_asymmetric">Public Key</string> <string name="label_asymmetric">Public Key</string>
<string name="label_symmetric">Pass Phrase</string> <string name="label_symmetric">Pass Phrase</string>
<string name="label_passPhraseCacheTtl">Pass Phrase Cache</string>
<string name="label_messageCompression">Message Compression</string>
<string name="label_fileCompression">File Compression</string>
<string name="noKeysSelected">Select</string> <string name="noKeysSelected">Select</string>
<string name="oneKeySelected">1 Selected</string> <string name="oneKeySelected">1 Selected</string>
@ -108,9 +112,16 @@
<string name="notValid">not valid</string> <string name="notValid">not valid</string>
<!-- choice_lowerCase: capitalized firwst word, no punctuation --> <!-- choice_lowerCase: capitalized firwst word, no punctuation -->
<string name="choice_none">None</string>
<string name="choice_signOnly">Sign only</string> <string name="choice_signOnly">Sign only</string>
<string name="choice_encryptOnly">Encrypt only</string> <string name="choice_encryptOnly">Encrypt only</string>
<string name="choice_signAndEncrypt">Sign and Encrypt</string> <string name="choice_signAndEncrypt">Sign and Encrypt</string>
<string name="choice_15secs">15 secs</string>
<string name="choice_1min">1 min</string>
<string name="choice_3mins">3 mins</string>
<string name="choice_5mins">5 mins</string>
<string name="choice_10mins">10 mins</string>
<string name="choice_untilQuit">until quit</string>
<string name="dsa">DSA</string> <string name="dsa">DSA</string>
<string name="elgamal">ElGamal</string> <string name="elgamal">ElGamal</string>
@ -150,7 +161,7 @@
<string name="specifyFileToEncryptTo">Please specify which file to encrypt to.\nWARNING! File will be overwritten if it exists.</string> <string name="specifyFileToEncryptTo">Please specify which file to encrypt to.\nWARNING! File will be overwritten if it exists.</string>
<string name="specifyFileToDecryptTo">Please specify which file to decrypt to.\nWARNING! File will be overwritten if it exists.</string> <string name="specifyFileToDecryptTo">Please specify which file to decrypt to.\nWARNING! File will be overwritten if it exists.</string>
<string name="specifyGoogleMailAccount">Specify the Google Mail account you want to add.</string> <string name="specifyGoogleMailAccount">Specify the Google Mail account you want to add.</string>
<string name="specifyFileToImportFrom">Please specify which file to import from.</string> <string name="specifyFileToImportFrom">Please specify which file to import keys from. (.asc or .gpg)</string>
<string name="specifyFileToExportTo">Please specify which file to export to.\nWARNING! File will be overwritten if it exists.</string> <string name="specifyFileToExportTo">Please specify which file to export to.\nWARNING! File will be overwritten if it exists.</string>
<string name="specifyFileToExportSecretKeysTo">Please specify which file to export to.\nWARNING! You are about to export SECRET keys.\nWARNING! File will be overwritten if it exists.</string> <string name="specifyFileToExportSecretKeysTo">Please specify which file to export to.\nWARNING! You are about to export SECRET keys.\nWARNING! File will be overwritten if it exists.</string>
<string name="keyDeletionConfirmation">Do you really want to delete the key '%s'?\nYou can't undo this!</string> <string name="keyDeletionConfirmation">Do you really want to delete the key '%s'?\nYou can't undo this!</string>

View File

@ -42,6 +42,7 @@
<!-- section_lowerCase: capitalized words, no punctuation --> <!-- section_lowerCase: capitalized words, no punctuation -->
<string name="section_userIds">User IDs</string> <string name="section_userIds">User IDs</string>
<string name="section_keys">Keys</string> <string name="section_keys">Keys</string>
<string name="section_general">General</string>
<string name="section_defaults">Defaults</string> <string name="section_defaults">Defaults</string>
<!-- btn_lowerCase: capitalized words, no punctuation --> <!-- btn_lowerCase: capitalized words, no punctuation -->
@ -92,6 +93,9 @@
<string name="label_hashAlgorithm">Hash Algorithm</string> <string name="label_hashAlgorithm">Hash Algorithm</string>
<string name="label_asymmetric">Public Key</string> <string name="label_asymmetric">Public Key</string>
<string name="label_symmetric">Pass Phrase</string> <string name="label_symmetric">Pass Phrase</string>
<string name="label_passPhraseCacheTtl">Pass Phrase Cache</string>
<string name="label_messageCompression">Message Compression</string>
<string name="label_fileCompression">File Compression</string>
<string name="noKeysSelected">Select</string> <string name="noKeysSelected">Select</string>
<string name="oneKeySelected">1 Selected</string> <string name="oneKeySelected">1 Selected</string>
@ -108,9 +112,16 @@
<string name="notValid">not valid</string> <string name="notValid">not valid</string>
<!-- choice_lowerCase: capitalized firwst word, no punctuation --> <!-- choice_lowerCase: capitalized firwst word, no punctuation -->
<string name="choice_none">None</string>
<string name="choice_signOnly">Sign only</string> <string name="choice_signOnly">Sign only</string>
<string name="choice_encryptOnly">Encrypt only</string> <string name="choice_encryptOnly">Encrypt only</string>
<string name="choice_signAndEncrypt">Sign and Encrypt</string> <string name="choice_signAndEncrypt">Sign and Encrypt</string>
<string name="choice_15secs">15 secs</string>
<string name="choice_1min">1 min</string>
<string name="choice_3mins">3 mins</string>
<string name="choice_5mins">5 mins</string>
<string name="choice_10mins">10 mins</string>
<string name="choice_untilQuit">until quit</string>
<string name="dsa">DSA</string> <string name="dsa">DSA</string>
<string name="elgamal">ElGamal</string> <string name="elgamal">ElGamal</string>
@ -150,7 +161,7 @@
<string name="specifyFileToEncryptTo">Please specify which file to encrypt to.\nWARNING! File will be overwritten if it exists.</string> <string name="specifyFileToEncryptTo">Please specify which file to encrypt to.\nWARNING! File will be overwritten if it exists.</string>
<string name="specifyFileToDecryptTo">Please specify which file to decrypt to.\nWARNING! File will be overwritten if it exists.</string> <string name="specifyFileToDecryptTo">Please specify which file to decrypt to.\nWARNING! File will be overwritten if it exists.</string>
<string name="specifyGoogleMailAccount">Specify the Google Mail account you want to add.</string> <string name="specifyGoogleMailAccount">Specify the Google Mail account you want to add.</string>
<string name="specifyFileToImportFrom">Please specify which file to import from.</string> <string name="specifyFileToImportFrom">Please specify which file to import keys from. (.asc or .gpg)</string>
<string name="specifyFileToExportTo">Please specify which file to export to.\nWARNING! File will be overwritten if it exists.</string> <string name="specifyFileToExportTo">Please specify which file to export to.\nWARNING! File will be overwritten if it exists.</string>
<string name="specifyFileToExportSecretKeysTo">Please specify which file to export to.\nWARNING! You are about to export SECRET keys.\nWARNING! File will be overwritten if it exists.</string> <string name="specifyFileToExportSecretKeysTo">Please specify which file to export to.\nWARNING! You are about to export SECRET keys.\nWARNING! File will be overwritten if it exists.</string>
<string name="keyDeletionConfirmation">Do you really want to delete the key '%s'?\nYou can't undo this!</string> <string name="keyDeletionConfirmation">Do you really want to delete the key '%s'?\nYou can't undo this!</string>

View File

@ -42,6 +42,7 @@
<!-- section_lowerCase: capitalized words, no punctuation --> <!-- section_lowerCase: capitalized words, no punctuation -->
<string name="section_userIds">User IDs</string> <string name="section_userIds">User IDs</string>
<string name="section_keys">Keys</string> <string name="section_keys">Keys</string>
<string name="section_general">General</string>
<string name="section_defaults">Defaults</string> <string name="section_defaults">Defaults</string>
<!-- btn_lowerCase: capitalized words, no punctuation --> <!-- btn_lowerCase: capitalized words, no punctuation -->
@ -92,6 +93,9 @@
<string name="label_hashAlgorithm">Hash Algorithm</string> <string name="label_hashAlgorithm">Hash Algorithm</string>
<string name="label_asymmetric">Public Key</string> <string name="label_asymmetric">Public Key</string>
<string name="label_symmetric">Pass Phrase</string> <string name="label_symmetric">Pass Phrase</string>
<string name="label_passPhraseCacheTtl">Pass Phrase Cache</string>
<string name="label_messageCompression">Message Compression</string>
<string name="label_fileCompression">File Compression</string>
<string name="noKeysSelected">Select</string> <string name="noKeysSelected">Select</string>
<string name="oneKeySelected">1 Selected</string> <string name="oneKeySelected">1 Selected</string>
@ -108,9 +112,16 @@
<string name="notValid">not valid</string> <string name="notValid">not valid</string>
<!-- choice_lowerCase: capitalized firwst word, no punctuation --> <!-- choice_lowerCase: capitalized firwst word, no punctuation -->
<string name="choice_none">None</string>
<string name="choice_signOnly">Sign only</string> <string name="choice_signOnly">Sign only</string>
<string name="choice_encryptOnly">Encrypt only</string> <string name="choice_encryptOnly">Encrypt only</string>
<string name="choice_signAndEncrypt">Sign and Encrypt</string> <string name="choice_signAndEncrypt">Sign and Encrypt</string>
<string name="choice_15secs">15 secs</string>
<string name="choice_1min">1 min</string>
<string name="choice_3mins">3 mins</string>
<string name="choice_5mins">5 mins</string>
<string name="choice_10mins">10 mins</string>
<string name="choice_untilQuit">until quit</string>
<string name="dsa">DSA</string> <string name="dsa">DSA</string>
<string name="elgamal">ElGamal</string> <string name="elgamal">ElGamal</string>
@ -150,7 +161,7 @@
<string name="specifyFileToEncryptTo">Please specify which file to encrypt to.\nWARNING! File will be overwritten if it exists.</string> <string name="specifyFileToEncryptTo">Please specify which file to encrypt to.\nWARNING! File will be overwritten if it exists.</string>
<string name="specifyFileToDecryptTo">Please specify which file to decrypt to.\nWARNING! File will be overwritten if it exists.</string> <string name="specifyFileToDecryptTo">Please specify which file to decrypt to.\nWARNING! File will be overwritten if it exists.</string>
<string name="specifyGoogleMailAccount">Specify the Google Mail account you want to add.</string> <string name="specifyGoogleMailAccount">Specify the Google Mail account you want to add.</string>
<string name="specifyFileToImportFrom">Please specify which file to import from.</string> <string name="specifyFileToImportFrom">Please specify which file to import keys from. (.asc or .gpg)</string>
<string name="specifyFileToExportTo">Please specify which file to export to.\nWARNING! File will be overwritten if it exists.</string> <string name="specifyFileToExportTo">Please specify which file to export to.\nWARNING! File will be overwritten if it exists.</string>
<string name="specifyFileToExportSecretKeysTo">Please specify which file to export to.\nWARNING! You are about to export SECRET keys.\nWARNING! File will be overwritten if it exists.</string> <string name="specifyFileToExportSecretKeysTo">Please specify which file to export to.\nWARNING! You are about to export SECRET keys.\nWARNING! File will be overwritten if it exists.</string>
<string name="keyDeletionConfirmation">Do you really want to delete the key '%s'?\nYou can't undo this!</string> <string name="keyDeletionConfirmation">Do you really want to delete the key '%s'?\nYou can't undo this!</string>

View File

@ -161,7 +161,7 @@
<string name="specifyFileToEncryptTo">Please specify which file to encrypt to.\nWARNING! File will be overwritten if it exists.</string> <string name="specifyFileToEncryptTo">Please specify which file to encrypt to.\nWARNING! File will be overwritten if it exists.</string>
<string name="specifyFileToDecryptTo">Please specify which file to decrypt to.\nWARNING! File will be overwritten if it exists.</string> <string name="specifyFileToDecryptTo">Please specify which file to decrypt to.\nWARNING! File will be overwritten if it exists.</string>
<string name="specifyGoogleMailAccount">Specify the Google Mail account you want to add.</string> <string name="specifyGoogleMailAccount">Specify the Google Mail account you want to add.</string>
<string name="specifyFileToImportFrom">Please specify which file to import from.</string> <string name="specifyFileToImportFrom">Please specify which file to import keys from. (.asc or .gpg)</string>
<string name="specifyFileToExportTo">Please specify which file to export to.\nWARNING! File will be overwritten if it exists.</string> <string name="specifyFileToExportTo">Please specify which file to export to.\nWARNING! File will be overwritten if it exists.</string>
<string name="specifyFileToExportSecretKeysTo">Please specify which file to export to.\nWARNING! You are about to export SECRET keys.\nWARNING! File will be overwritten if it exists.</string> <string name="specifyFileToExportSecretKeysTo">Please specify which file to export to.\nWARNING! You are about to export SECRET keys.\nWARNING! File will be overwritten if it exists.</string>
<string name="keyDeletionConfirmation">Do you really want to delete the key '%s'?\nYou can't undo this!</string> <string name="keyDeletionConfirmation">Do you really want to delete the key '%s'?\nYou can't undo this!</string>

View File

@ -115,7 +115,7 @@ public class EditKeyActivity extends BaseActivity implements OnClickListener {
Toast.makeText(this, "Warning: Key editing is still kind of beta.", Toast.LENGTH_LONG).show(); Toast.makeText(this, "Warning: Key editing is still kind of beta.", Toast.LENGTH_LONG).show();
} }
public long getMasterKeyId() { private long getMasterKeyId() {
if (mKeys.getEditors().getChildCount() == 0) { if (mKeys.getEditors().getChildCount() == 0) {
return 0; return 0;
} }
@ -243,6 +243,7 @@ public class EditKeyActivity extends BaseActivity implements OnClickListener {
newPassPhrase = oldPassPhrase; newPassPhrase = oldPassPhrase;
} }
Apg.buildSecretKey(this, mUserIds, mKeys, oldPassPhrase, newPassPhrase, this); Apg.buildSecretKey(this, mUserIds, mKeys, oldPassPhrase, newPassPhrase, this);
Apg.setCachedPassPhrase(getMasterKeyId(), newPassPhrase);
} catch (NoSuchProviderException e) { } catch (NoSuchProviderException e) {
error = e.getMessage(); error = e.getMessage();
} catch (NoSuchAlgorithmException e) { } catch (NoSuchAlgorithmException e) {

View File

@ -53,7 +53,7 @@ public class PublicKeyListActivity extends BaseActivity {
protected int mSelectedItem = -1; protected int mSelectedItem = -1;
protected int mTask = 0; protected int mTask = 0;
private String mImportFilename = Constants.path.app_dir + "/pubring.gpg"; private String mImportFilename = Constants.path.app_dir + "/";
private String mExportFilename = Constants.path.app_dir + "/pubexport.asc"; private String mExportFilename = Constants.path.app_dir + "/pubexport.asc";
@Override @Override

View File

@ -54,7 +54,7 @@ public class SecretKeyListActivity extends BaseActivity implements OnChildClickL
protected int mSelectedItem = -1; protected int mSelectedItem = -1;
protected int mTask = 0; protected int mTask = 0;
private String mImportFilename = Constants.path.app_dir + "/secring.gpg"; private String mImportFilename = Constants.path.app_dir + "/";
private String mExportFilename = Constants.path.app_dir + "/secexport.asc"; private String mExportFilename = Constants.path.app_dir + "/secexport.asc";
@Override @Override