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

Rename method to set'Key'ExpirationDateInSubpacketGenerator()

This commit is contained in:
Paul Schaub 2021-11-06 17:39:04 +01:00
parent d9ef55e22f
commit 2ac10e7bc7
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
3 changed files with 5 additions and 5 deletions

View file

@ -138,7 +138,7 @@ public class KeyRingBuilder implements KeyRingBuilderInterface<KeyRingBuilder> {
PGPSignatureSubpacketGenerator hashedSubPacketGenerator = primaryKeySpec.getSubpacketGenerator();
hashedSubPacketGenerator.setPrimaryUserID(false, true);
if (expirationDate != null) {
SignatureSubpacketGeneratorUtil.setExpirationDateInSubpacketGenerator(
SignatureSubpacketGeneratorUtil.setKeyExpirationDateInSubpacketGenerator(
expirationDate, new Date(), hashedSubPacketGenerator);
}
PGPSignatureSubpacketVector hashedSubPackets = hashedSubPacketGenerator.generate();

View file

@ -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());

View file

@ -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);