1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-26 22:32:07 +01:00

getEncryptionSubkeys(): Compare expirations against reference date

This commit is contained in:
Paul Schaub 2023-04-07 11:26:38 +02:00
parent ed2c53f5d6
commit acb5d3fd9e
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -903,7 +903,7 @@ public class KeyRingInfo {
*/ */
public @Nonnull List<PGPPublicKey> getEncryptionSubkeys(EncryptionPurpose purpose) { public @Nonnull List<PGPPublicKey> getEncryptionSubkeys(EncryptionPurpose purpose) {
Date primaryExpiration = getPrimaryKeyExpirationDate(); Date primaryExpiration = getPrimaryKeyExpirationDate();
if (primaryExpiration != null && primaryExpiration.before(new Date())) { if (primaryExpiration != null && primaryExpiration.before(referenceDate)) {
return Collections.emptyList(); return Collections.emptyList();
} }
@ -917,7 +917,7 @@ public class KeyRingInfo {
} }
Date subkeyExpiration = getSubkeyExpirationDate(OpenPgpFingerprint.of(subKey)); Date subkeyExpiration = getSubkeyExpirationDate(OpenPgpFingerprint.of(subKey));
if (subkeyExpiration != null && subkeyExpiration.before(new Date())) { if (subkeyExpiration != null && subkeyExpiration.before(referenceDate)) {
continue; continue;
} }