diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2014-05-03 15:59:25 +0200 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2014-05-03 15:59:25 +0200 |
commit | c2c6a90991397929b024f726e4d515095e21d9a2 (patch) | |
tree | 5755c271fc37d376222c750f2db1268300450b17 /OpenKeychain/src/main | |
parent | 4b3cfd4fa41ef8339a0691b38c4c6ec481b5c3df (diff) | |
download | open-keychain-c2c6a90991397929b024f726e4d515095e21d9a2.tar.gz open-keychain-c2c6a90991397929b024f726e4d515095e21d9a2.tar.bz2 open-keychain-c2c6a90991397929b024f726e4d515095e21d9a2.zip |
certification is always done with the master key
Diffstat (limited to 'OpenKeychain/src/main')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyHelper.java | 55 | ||||
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java | 2 |
2 files changed, 1 insertions, 56 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyHelper.java index ecaeac7e7..e884c0e2f 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyHelper.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyHelper.java @@ -112,20 +112,6 @@ public class PgpKeyHelper { @SuppressWarnings("unchecked") @Deprecated - private static Vector<PGPPublicKey> getEncryptKeys(PGPPublicKeyRing keyRing) { - Vector<PGPPublicKey> encryptKeys = new Vector<PGPPublicKey>(); - - for (PGPPublicKey key : new IterableIterator<PGPPublicKey>(keyRing.getPublicKeys())) { - if (isEncryptionKey(key)) { - encryptKeys.add(key); - } - } - - return encryptKeys; - } - - @SuppressWarnings("unchecked") - @Deprecated private static Vector<PGPSecretKey> getSigningKeys(PGPSecretKeyRing keyRing) { Vector<PGPSecretKey> signingKeys = new Vector<PGPSecretKey>(); @@ -138,39 +124,6 @@ public class PgpKeyHelper { return signingKeys; } - @SuppressWarnings("unchecked") - @Deprecated - private static Vector<PGPSecretKey> getCertificationKeys(PGPSecretKeyRing keyRing) { - Vector<PGPSecretKey> signingKeys = new Vector<PGPSecretKey>(); - - for (PGPSecretKey key : new IterableIterator<PGPSecretKey>(keyRing.getSecretKeys())) { - if (isCertificationKey(key)) { - signingKeys.add(key); - } - } - - return signingKeys; - } - - @Deprecated - private static Vector<PGPSecretKey> getUsableCertificationKeys(PGPSecretKeyRing keyRing) { - Vector<PGPSecretKey> usableKeys = new Vector<PGPSecretKey>(); - Vector<PGPSecretKey> signingKeys = getCertificationKeys(keyRing); - PGPSecretKey masterKey = null; - for (int i = 0; i < signingKeys.size(); ++i) { - PGPSecretKey key = signingKeys.get(i); - if (key.isMasterKey()) { - masterKey = key; - } else { - usableKeys.add(key); - } - } - if (masterKey != null) { - usableKeys.add(masterKey); - } - return usableKeys; - } - @Deprecated private static Vector<PGPSecretKey> getUsableSigningKeys(PGPSecretKeyRing keyRing) { Vector<PGPSecretKey> usableKeys = new Vector<PGPSecretKey>(); @@ -190,14 +143,6 @@ public class PgpKeyHelper { return usableKeys; } - public static PGPSecretKey getFirstCertificationSubkey(PGPSecretKeyRing keyRing) { - Vector<PGPSecretKey> signingKeys = getUsableCertificationKeys(keyRing); - if (signingKeys.size() == 0) { - return null; - } - return signingKeys.get(0); - } - public static PGPSecretKey getFirstSigningSubkey(PGPSecretKeyRing keyRing) { Vector<PGPSecretKey> signingKeys = getUsableSigningKeys(keyRing); if (signingKeys.size() == 0) { diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java index 5615b59c4..99d12ee8b 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java @@ -836,7 +836,7 @@ public class KeychainIntentService extends IntentService Log.e(Constants.TAG, "key not found!", e); // TODO: throw exception here! } - PGPSecretKey certificationKey = PgpKeyHelper.getFirstCertificationSubkey(secretKeyRing); + PGPSecretKey certificationKey = secretKeyRing.getSecretKey(); publicKey = keyOperation.certifyKey(certificationKey, publicKey, userIds, signaturePassphrase); publicRing = PGPPublicKeyRing.insertPublicKey(publicRing, publicKey); |