diff --git a/pgpainless-core/src/main/java/org/pgpainless/key/info/KeyRingInfo.java b/pgpainless-core/src/main/java/org/pgpainless/key/info/KeyRingInfo.java index 6c1b5778..f5a23ca0 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/key/info/KeyRingInfo.java +++ b/pgpainless-core/src/main/java/org/pgpainless/key/info/KeyRingInfo.java @@ -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; }