From 2ac10e7bc76b39863c1106278658e6dd16fcaea1 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Sat, 6 Nov 2021 17:39:04 +0100 Subject: [PATCH] Rename method to set'Key'ExpirationDateInSubpacketGenerator() --- .../java/org/pgpainless/key/generation/KeyRingBuilder.java | 2 +- .../key/modification/secretkeyring/SecretKeyRingEditor.java | 2 +- .../subpackets/SignatureSubpacketGeneratorUtil.java | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pgpainless-core/src/main/java/org/pgpainless/key/generation/KeyRingBuilder.java b/pgpainless-core/src/main/java/org/pgpainless/key/generation/KeyRingBuilder.java index c9419d28..762757e0 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/key/generation/KeyRingBuilder.java +++ b/pgpainless-core/src/main/java/org/pgpainless/key/generation/KeyRingBuilder.java @@ -138,7 +138,7 @@ public class KeyRingBuilder implements KeyRingBuilderInterface { PGPSignatureSubpacketGenerator hashedSubPacketGenerator = primaryKeySpec.getSubpacketGenerator(); hashedSubPacketGenerator.setPrimaryUserID(false, true); if (expirationDate != null) { - SignatureSubpacketGeneratorUtil.setExpirationDateInSubpacketGenerator( + SignatureSubpacketGeneratorUtil.setKeyExpirationDateInSubpacketGenerator( expirationDate, new Date(), hashedSubPacketGenerator); } PGPSignatureSubpacketVector hashedSubPackets = hashedSubPacketGenerator.generate(); diff --git a/pgpainless-core/src/main/java/org/pgpainless/key/modification/secretkeyring/SecretKeyRingEditor.java b/pgpainless-core/src/main/java/org/pgpainless/key/modification/secretkeyring/SecretKeyRingEditor.java index 27e6046b..a83b4abd 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/key/modification/secretkeyring/SecretKeyRingEditor.java +++ b/pgpainless-core/src/main/java/org/pgpainless/key/modification/secretkeyring/SecretKeyRingEditor.java @@ -377,7 +377,7 @@ public class SecretKeyRingEditor implements SecretKeyRingEditorInterface { PGPSignatureSubpacketVector oldSubpackets = oldSignature.getHashedSubPackets(); PGPSignatureSubpacketGenerator subpacketGenerator = new PGPSignatureSubpacketGenerator(oldSubpackets); SignatureSubpacketGeneratorUtil.setSignatureCreationTimeInSubpacketGenerator(new Date(), subpacketGenerator); - SignatureSubpacketGeneratorUtil.setExpirationDateInSubpacketGenerator(expiration, subjectPubKey.getCreationTime(), subpacketGenerator); + SignatureSubpacketGeneratorUtil.setKeyExpirationDateInSubpacketGenerator(expiration, subjectPubKey.getCreationTime(), subpacketGenerator); PGPSignatureGenerator signatureGenerator = SignatureUtils.getSignatureGeneratorFor(primaryKey); signatureGenerator.setHashedSubpackets(subpacketGenerator.generate()); diff --git a/pgpainless-core/src/main/java/org/pgpainless/signature/subpackets/SignatureSubpacketGeneratorUtil.java b/pgpainless-core/src/main/java/org/pgpainless/signature/subpackets/SignatureSubpacketGeneratorUtil.java index 948441f3..fe493ac7 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/signature/subpackets/SignatureSubpacketGeneratorUtil.java +++ b/pgpainless-core/src/main/java/org/pgpainless/signature/subpackets/SignatureSubpacketGeneratorUtil.java @@ -88,9 +88,9 @@ public final class SignatureSubpacketGeneratorUtil { * @param creationDate date on which the key was created * @param subpacketGenerator subpacket generator */ - public static void setExpirationDateInSubpacketGenerator(Date expirationDate, - @Nonnull Date creationDate, - PGPSignatureSubpacketGenerator subpacketGenerator) { + public static void setKeyExpirationDateInSubpacketGenerator(Date expirationDate, + @Nonnull Date creationDate, + PGPSignatureSubpacketGenerator subpacketGenerator) { removeAllPacketsOfType(SignatureSubpacketTags.KEY_EXPIRE_TIME, subpacketGenerator); long secondsToExpire = getKeyLifetimeInSeconds(expirationDate, creationDate); subpacketGenerator.setKeyExpirationTime(true, secondsToExpire);