diff options
Diffstat (limited to 'OpenPGP-Keychain/src/org/sufficientlysecure/keychain/helper/PgpHelper.java')
-rw-r--r-- | OpenPGP-Keychain/src/org/sufficientlysecure/keychain/helper/PgpHelper.java | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/helper/PgpHelper.java b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/helper/PgpHelper.java index 810f3a6f2..60450ffb8 100644 --- a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/helper/PgpHelper.java +++ b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/helper/PgpHelper.java @@ -480,18 +480,7 @@ public class PgpHelper { } public static boolean isSecretKeyPrivateEmpty(PGPSecretKey secretKey) { - try { - PBESecretKeyDecryptor keyDecryptor = new JcePBESecretKeyDecryptorBuilder() - .setProvider(PgpMain.BOUNCY_CASTLE_PROVIDER_NAME).build(new char[] {}); - PGPPrivateKey testKey = secretKey.extractPrivateKey( - keyDecryptor); - if (testKey != null) { - return false; - } - } catch (PGPException e) { //exception if wrong key => not empty - return false; //all good if this fails, we likely didn't use the right password - } - return true; + return secretKey.isPrivateKeyEmpty(); } public static boolean isSecretKeyPrivateEmpty(Context context, long keyId) { |