Class OnePassSignaturePacket

    • Constructor Detail

      • OnePassSignaturePacket

        public OnePassSignaturePacket​(int sigType,
                                      int hashAlgorithm,
                                      int keyAlgorithm,
                                      long keyID,
                                      boolean isNested)
        Create a version 3 OnePassSignaturePacket. Version 3 OPS packets are used with version 3 and version 4 SignaturePackets. To create an OPS packet for use with a version 6 SignaturePacket, see OnePassSignaturePacket(int, int, int, byte[], byte[], boolean).
        Parameters:
        sigType - signature type
        hashAlgorithm - hash algorithm tag
        keyAlgorithm - public key algorithm tag
        keyID - id of the signing key
        isNested - if false, there is another OPS packet after this one, which applies to the same data. it true, the corresponding signature is calculated also over succeeding additional OPS packets.
      • OnePassSignaturePacket

        public OnePassSignaturePacket​(int sigType,
                                      int hashAlgorithm,
                                      int keyAlgorithm,
                                      byte[] salt,
                                      byte[] fingerprint,
                                      boolean isNested)
        Create a version 6 OnePassSignaturePacket.
        Parameters:
        sigType - signature type
        hashAlgorithm - hash algorithm tag
        keyAlgorithm - public key algorithm tag
        salt - random salt. The length of this array depends on the hash algorithm in use.
        fingerprint - 32 octet fingerprint of the (v6) signing key
        isNested - if false, there is another OPS packet after this one, which applies to the same data. it true, the corresponding signature is calculated also over succeeding additional OPS packets.
    • Method Detail

      • getVersion

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

        public int getSignatureType()
        Return the signature type.
        Returns:
        the signature type
      • getKeyAlgorithm

        public int getKeyAlgorithm()
        Return the ID of the public key encryption algorithm.
        Returns:
        public key algorithm tag
      • getHashAlgorithm

        public int getHashAlgorithm()
        Return the algorithm ID of the hash algorithm.
        Returns:
        hash algorithm tag
      • getKeyID

        public long getKeyID()
        Return the key-id of the signing key.
        Returns:
        key id
      • getFingerprint

        public byte[] getFingerprint()
        Return the version 6 fingerprint of the issuer. Only for version 6 packets.
        Returns:
        32 bytes issuer fingerprint
      • getSalt

        public byte[] getSalt()
        Return the salt used in the signature. Only for version 6 packets.
        Returns:
        salt
      • isContaining

        public boolean isContaining()
        Return true, if the signature contains any signatures that follow. A bracketing OPS is followed by additional OPS packets and is calculated over all the data between itself and its corresponding signature (it is an attestation for encapsulated signatures).
        Returns:
        true if encapsulating, false otherwise
      • encode

        public void encode​(BCPGOutputStream out)
                    throws java.io.IOException
        Encode the contents of this packet into the given packet output stream.
        Specified by:
        encode in class ContainedPacket
        Parameters:
        out - OpenPGP packet output stream
        Throws:
        java.io.IOException