minor fixes to make key retrieval more stable

This commit is contained in:
Thialfihar
2010-05-30 16:53:04 +00:00
parent d1fa1895f1
commit d483feb64c
2 changed files with 18 additions and 2 deletions

View File

@@ -648,6 +648,9 @@ public class Apg {
}
public static PGPPublicKey getMasterKey(PGPPublicKeyRing keyRing) {
if (keyRing == null) {
return null;
}
for (PGPPublicKey key : new IterableIterator<PGPPublicKey>(keyRing.getPublicKeys())) {
if (key.isMasterKey()) {
return key;
@@ -658,6 +661,9 @@ public class Apg {
}
public static PGPSecretKey getMasterKey(PGPSecretKeyRing keyRing) {
if (keyRing == null) {
return null;
}
for (PGPSecretKey key : new IterableIterator<PGPSecretKey>(keyRing.getSecretKeys())) {
if (key.isMasterKey()) {
return key;