Class SignatureSubpacketGeneratorUtil
- java.lang.Object
-
- org.pgpainless.signature.subpackets.SignatureSubpacketGeneratorUtil
-
public final class SignatureSubpacketGeneratorUtil extends Object
Utility class that helps to deal with BCs SignatureSubpacketGenerator class.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
removeAllPacketsOfType(int type, org.bouncycastle.openpgp.PGPSignatureSubpacketGenerator subpacketGenerator)
Remove all packets of the given type from thePGPSignatureSubpacketGenerators
internal set.static void
removeAllPacketsOfType(SignatureSubpacket subpacketType, org.bouncycastle.openpgp.PGPSignatureSubpacketGenerator subpacketGenerator)
Remove all packets of the given type from thePGPSignatureSubpacketGenerators
internal set.static void
setKeyExpirationDateInSubpacketGenerator(Date expirationDate, Date creationDate, org.bouncycastle.openpgp.PGPSignatureSubpacketGenerator subpacketGenerator)
Replace all occurrences of key expiration time subpackets in the subpacket generator with a single instance representing the new expiration time.static void
setSignatureCreationTimeInSubpacketGenerator(Date date, org.bouncycastle.openpgp.PGPSignatureSubpacketGenerator subpacketGenerator)
Replace all occurrences of a signature creation time subpackets in the subpacket generator with a single new instance representing the provided date.
-
-
-
Method Detail
-
removeAllPacketsOfType
public static void removeAllPacketsOfType(SignatureSubpacket subpacketType, org.bouncycastle.openpgp.PGPSignatureSubpacketGenerator subpacketGenerator)
Remove all packets of the given type from thePGPSignatureSubpacketGenerators
internal set.- Parameters:
subpacketType
- type of subpacket to removesubpacketGenerator
- subpacket generator
-
removeAllPacketsOfType
public static void removeAllPacketsOfType(int type, org.bouncycastle.openpgp.PGPSignatureSubpacketGenerator subpacketGenerator)
Remove all packets of the given type from thePGPSignatureSubpacketGenerators
internal set.- Parameters:
type
- type of subpacket to removesubpacketGenerator
- subpacket generator
-
setSignatureCreationTimeInSubpacketGenerator
public static void setSignatureCreationTimeInSubpacketGenerator(Date date, org.bouncycastle.openpgp.PGPSignatureSubpacketGenerator subpacketGenerator)
Replace all occurrences of a signature creation time subpackets in the subpacket generator with a single new instance representing the provided date.- Parameters:
date
- signature creation timesubpacketGenerator
- subpacket generator
-
setKeyExpirationDateInSubpacketGenerator
public static void setKeyExpirationDateInSubpacketGenerator(Date expirationDate, @Nonnull Date creationDate, org.bouncycastle.openpgp.PGPSignatureSubpacketGenerator subpacketGenerator)
Replace all occurrences of key expiration time subpackets in the subpacket generator with a single instance representing the new expiration time.- Parameters:
expirationDate
- expiration time as date or null for no expirationcreationDate
- date on which the key was createdsubpacketGenerator
- subpacket generator
-
-