Class SignatureSubpacketGeneratorUtil


  • public class SignatureSubpacketGeneratorUtil
    extends java.lang.Object
    Utility class that helps dealing with BCs SignatureSubpacketGenerator class.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <P extends org.bouncycastle.bcpg.SignatureSubpacket>
      java.util.List<P>
      getSubpacketsOfType​(SignatureSubpacket type, org.bouncycastle.openpgp.PGPSignatureSubpacketGenerator generator)  
      static boolean hasKeyFlag​(KeyFlag keyFlag, org.bouncycastle.openpgp.PGPSignatureSubpacketGenerator generator)  
      static void removeAllPacketsOfType​(int type, org.bouncycastle.openpgp.PGPSignatureSubpacketGenerator subpacketGenerator)  
      static void removeAllPacketsOfType​(SignatureSubpacket subpacketType, org.bouncycastle.openpgp.PGPSignatureSubpacketGenerator subpacketGenerator)  
      static void setExpirationDateInSubpacketGenerator​(java.util.Date expirationDate, java.util.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​(java.util.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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SignatureSubpacketGeneratorUtil

        public SignatureSubpacketGeneratorUtil()
    • Method Detail

      • getSubpacketsOfType

        public static <P extends org.bouncycastle.bcpg.SignatureSubpacket> java.util.List<P> getSubpacketsOfType​(SignatureSubpacket type,
                                                                                                                 org.bouncycastle.openpgp.PGPSignatureSubpacketGenerator generator)
      • removeAllPacketsOfType

        public static void removeAllPacketsOfType​(SignatureSubpacket subpacketType,
                                                  org.bouncycastle.openpgp.PGPSignatureSubpacketGenerator subpacketGenerator)
      • removeAllPacketsOfType

        public static void removeAllPacketsOfType​(int type,
                                                  org.bouncycastle.openpgp.PGPSignatureSubpacketGenerator subpacketGenerator)
      • setSignatureCreationTimeInSubpacketGenerator

        public static void setSignatureCreationTimeInSubpacketGenerator​(java.util.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 time
        subpacketGenerator - subpacket generator
      • setExpirationDateInSubpacketGenerator

        public static void setExpirationDateInSubpacketGenerator​(java.util.Date expirationDate,
                                                                 @Nonnull
                                                                 java.util.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 expiration
        creationDate - date on which the key was created
        subpacketGenerator - subpacket generator
      • hasKeyFlag

        public static boolean hasKeyFlag​(KeyFlag keyFlag,
                                         org.bouncycastle.openpgp.PGPSignatureSubpacketGenerator generator)