mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-23 12:52:07 +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() {
|
public @Nonnull Date getLatestKeyCreationDate() {
|
||||||
Date latestCreation = null;
|
Date latestCreation = null;
|
||||||
for (PGPPublicKey key : getPublicKeys()) {
|
for (PGPPublicKey key : getPublicKeys()) {
|
||||||
|
if (!isKeyValidlyBound(key.getKeyID())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
Date keyCreation = key.getCreationTime();
|
Date keyCreation = key.getCreationTime();
|
||||||
if (latestCreation == null || latestCreation.before(keyCreation)) {
|
if (latestCreation == null || latestCreation.before(keyCreation)) {
|
||||||
latestCreation = keyCreation;
|
latestCreation = keyCreation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (latestCreation == null) {
|
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;
|
return latestCreation;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue