mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-23 04:42:06 +01:00
Only consider validly bound subkeys when determining latest key creation date
This commit is contained in:
parent
aef213a672
commit
23b714f61b
1 changed files with 4 additions and 1 deletions
|
@ -532,13 +532,16 @@ public class KeyRingInfo {
|
|||
public @Nonnull Date getLatestKeyCreationDate() {
|
||||
Date latestCreation = null;
|
||||
for (PGPPublicKey key : getPublicKeys()) {
|
||||
if (!isKeyValidlyBound(key.getKeyID())) {
|
||||
continue;
|
||||
}
|
||||
Date keyCreation = key.getCreationTime();
|
||||
if (latestCreation == null || latestCreation.before(keyCreation)) {
|
||||
latestCreation = keyCreation;
|
||||
}
|
||||
}
|
||||
if (latestCreation == null) {
|
||||
throw new AssertionError("Apparently there is no key in this key ring.");
|
||||
throw new AssertionError("Apparently there is no validly bound key in this key ring.");
|
||||
}
|
||||
return latestCreation;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue