give key editing its own pass phrase mechanism, as the new cache won't work there

This commit is contained in:
Thialfihar
2010-05-16 13:35:16 +00:00
parent 9855f4d144
commit c7f0041751
3 changed files with 33 additions and 8 deletions

View File

@@ -158,6 +158,7 @@ public class Apg {
private static HashMap<Long, CachedPassPhrase> mPassPhraseCache =
new HashMap<Long, CachedPassPhrase>();
private static String mEditPassPhrase = null;
public static class GeneralException extends Exception {
static final long serialVersionUID = 0xf812773342L;
@@ -273,6 +274,14 @@ public class Apg {
}
}
public static void setEditPassPhrase(String passPhrase) {
mEditPassPhrase = passPhrase;
}
public static String getEditPassPhrase() {
return mEditPassPhrase;
}
public static void setCachedPassPhrase(long keyId, String passPhrase) {
mPassPhraseCache.put(keyId, new CachedPassPhrase(new Date().getTime(), passPhrase));
}