Class SignaturePacket

    • Constructor Detail

      • SignaturePacket

        public SignaturePacket​(int signatureType,
                               long keyID,
                               int keyAlgorithm,
                               int hashAlgorithm,
                               SignatureSubpacket[] hashedData,
                               SignatureSubpacket[] unhashedData,
                               byte[] fingerPrint,
                               MPInteger[] signature)
        Generate a version 4 signature packet.
        Parameters:
        signatureType -
        keyAlgorithm -
        hashAlgorithm -
        hashedData -
        unhashedData -
        fingerPrint -
        signature -
      • SignaturePacket

        public SignaturePacket​(int version,
                               int signatureType,
                               long keyID,
                               int keyAlgorithm,
                               int hashAlgorithm,
                               long creationTime,
                               byte[] fingerPrint,
                               MPInteger[] signature)
        Generate a version 2/3 signature packet.
        Parameters:
        signatureType -
        keyAlgorithm -
        hashAlgorithm -
        fingerPrint -
        signature -
      • SignaturePacket

        public SignaturePacket​(int version,
                               int signatureType,
                               long keyID,
                               int keyAlgorithm,
                               int hashAlgorithm,
                               SignatureSubpacket[] hashedData,
                               SignatureSubpacket[] unhashedData,
                               byte[] fingerPrint,
                               MPInteger[] signature)
    • Method Detail

      • getVersion

        public int getVersion()
        get the version number
      • getSignatureType

        public int getSignatureType()
        return the signature type.
      • getKeyID

        public long getKeyID()
        return the keyID
        Returns:
        the keyID that created the signature.
      • getSignatureTrailer

        public byte[] getSignatureTrailer()
        return the signature trailer that must be included with the data to reconstruct the signature
        Returns:
        byte[]
      • getKeyAlgorithm

        public int getKeyAlgorithm()
        return the encryption algorithm tag
      • getHashAlgorithm

        public int getHashAlgorithm()
        return the hashAlgorithm tag
      • getSignature

        public MPInteger[] getSignature()
        return the signature as a set of integers - note this is normalised to be the ASN.1 encoding of what appears in the signature packet.
      • getSignatureBytes

        public byte[] getSignatureBytes()
        Return the byte encoding of the signature section.
        Returns:
        uninterpreted signature bytes.
      • getCreationTime

        public long getCreationTime()
        Return the creation time of the signature in milli-seconds.
        Returns:
        the creation time in millis
      • fromByteArray

        public static SignaturePacket fromByteArray​(byte[] data)
                                             throws java.io.IOException
        Throws:
        java.io.IOException