aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src
diff options
context:
space:
mode:
authorDominik Schürmann <dominik@dominikschuermann.de>2014-04-11 21:40:12 +0200
committerDominik Schürmann <dominik@dominikschuermann.de>2014-04-11 21:40:12 +0200
commit2069f20f50b808fad8fea3639e82eadd0d9bd9e7 (patch)
tree1f4071ef8682ef8d2d0c41ec9781cbb5a5fd3def /OpenKeychain/src
parent12b8282d9b6b1723d8c4086911970d2f1188f53a (diff)
downloadopen-keychain-2069f20f50b808fad8fea3639e82eadd0d9bd9e7.tar.gz
open-keychain-2069f20f50b808fad8fea3639e82eadd0d9bd9e7.tar.bz2
open-keychain-2069f20f50b808fad8fea3639e82eadd0d9bd9e7.zip
Clarify use of methods in PgpKeyHelper
Diffstat (limited to 'OpenKeychain/src')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyHelper.java6
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncrypt.java4
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java2
3 files changed, 6 insertions, 6 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 82136ac1b..d36dd8efe 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyHelper.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyHelper.java
@@ -199,7 +199,7 @@ public class PgpKeyHelper {
return getExpiryDate(key.getPublicKey());
}
- public static PGPPublicKey getEncryptPublicKey(PGPPublicKeyRing keyRing) {
+ public static PGPPublicKey getFirstEncryptSubkey(PGPPublicKeyRing keyRing) {
Vector<PGPPublicKey> encryptKeys = getUsableEncryptKeys(keyRing);
if (encryptKeys.size() == 0) {
Log.e(Constants.TAG, "encryptKeys is null!");
@@ -208,7 +208,7 @@ public class PgpKeyHelper {
return encryptKeys.get(0);
}
- public static PGPSecretKey getCertificationKey(PGPSecretKeyRing keyRing) {
+ public static PGPSecretKey getFirstCertificationSubkey(PGPSecretKeyRing keyRing) {
Vector<PGPSecretKey> signingKeys = getUsableCertificationKeys(keyRing);
if (signingKeys.size() == 0) {
return null;
@@ -216,7 +216,7 @@ public class PgpKeyHelper {
return signingKeys.get(0);
}
- public static PGPSecretKey getSigningKey(PGPSecretKeyRing keyRing) {
+ public static PGPSecretKey getFirstSigningSubkey(PGPSecretKeyRing keyRing) {
Vector<PGPSecretKey> signingKeys = getUsableSigningKeys(keyRing);
if (signingKeys.size() == 0) {
return null;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncrypt.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncrypt.java
index 418433427..16b060c10 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncrypt.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncrypt.java
@@ -289,7 +289,7 @@ public class PgpSignEncrypt {
throw new NoSigningKeyException();
// throw new PgpGeneralException(mContext.getString(R.string.error_signature_failed));
}
- signingKey = PgpKeyHelper.getSigningKey(signingKeyRing);
+ signingKey = PgpKeyHelper.getFirstSigningSubkey(signingKeyRing);
if (signingKey == null) {
throw new NoSigningKeyException();
// throw new PgpGeneralException(mContext.getString(R.string.error_signature_failed));
@@ -337,7 +337,7 @@ public class PgpSignEncrypt {
for (long id : mEncryptionMasterKeyIds) {
try {
PGPPublicKeyRing keyRing = mProviderHelper.getPGPPublicKeyRing(id);
- PGPPublicKey key = PgpKeyHelper.getEncryptPublicKey(keyRing);
+ PGPPublicKey key = PgpKeyHelper.getFirstEncryptSubkey(keyRing);
if (key != null) {
JcePublicKeyKeyEncryptionMethodGenerator pubKeyEncryptionGenerator =
new JcePublicKeyKeyEncryptionMethodGenerator(key);
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 d54bc7de6..1ca143be0 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
@@ -833,7 +833,7 @@ public class KeychainIntentService extends IntentService
Log.e(Constants.TAG, "key not found!", e);
// TODO: throw exception here!
}
- PGPSecretKey certificationKey = PgpKeyHelper.getCertificationKey(secretKeyRing);
+ PGPSecretKey certificationKey = PgpKeyHelper.getFirstCertificationSubkey(secretKeyRing);
publicKey = keyOperation.certifyKey(certificationKey, publicKey,
userIds, signaturePassphrase);
publicRing = PGPPublicKeyRing.insertPublicKey(publicRing, publicKey);