Class PublicKeyPacket

    • Constructor Detail

      • PublicKeyPacket

        @Deprecated
        public PublicKeyPacket​(int algorithm,
                               java.util.Date time,
                               BCPGKey key)
        Deprecated.
        Construct version 4 public primary key packet.
        Parameters:
        algorithm - public key algorithm id
        time - creation time
        key - key object
      • PublicKeyPacket

        public PublicKeyPacket​(int version,
                               int algorithm,
                               java.util.Date time,
                               BCPGKey key)
        Construct an OpenPGP public primary key packet.
        Parameters:
        version - packet version
        algorithm - public key algorithm id
        time - creation time
        key - key object
    • Method Detail

      • getVersion

        public int getVersion()
        Return the packet version.
        Returns:
        packet version
      • getAlgorithm

        public int getAlgorithm()
        Return the algorithm id of the public key.
        Returns:
        algorithm id
      • getValidDays

        public int getValidDays()
        Deprecated.
        v4 and v6 keys instead signal their expiration time via the KeyExpirationTime signature subpacket.
        Only for v3 keys - The time in days since the keys creation, during which the key is valid.
        Returns:
        v3 key validity period in days since creation.
      • getTime

        public java.util.Date getTime()
        Return the keys creation time.
        Returns:
        creation time of the key
      • getKey

        public BCPGKey getKey()
        Return the key object.
        Returns:
        key
      • getEncodedContents

        public byte[] getEncodedContents()
                                  throws java.io.IOException
        Return the encoded packet contents without the packet frame.
        Returns:
        encoded packet contents
        Throws:
        java.io.IOException
      • getKeyID

        public static long getKeyID​(PublicKeyPacket publicPk,
                                    byte[] fingerprint)