All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bouncycastle.bcpg.Packet Maven / Gradle / Ivy

Go to download

The Bouncy Castle Java API for handling the OpenPGP protocol. This jar contains the OpenPGP API for JDK 1.5 to JDK 1.8. The APIs can be used in conjunction with a JCE/JCA provider such as the one provided with the Bouncy Castle Cryptography APIs.

There is a newer version: 1.79
Show newest version
package org.bouncycastle.bcpg;

/**
 */
public class Packet
    implements PacketTags
{
    private final int packetTag;

    // for API compatibility
    public Packet()
    {
        this(RESERVED);
    }

    Packet(int packetTag)
    {
        this.packetTag = packetTag;
    }

    /**
     * Return the tag of the packet.
     *
     * @return packet tag
     */
    public final int getPacketTag()
    {
         return packetTag;
    }

    /**
     * Returns whether the packet is to be considered critical for v6 implementations.
     * Packets with tags less or equal to 39 are critical.
     * Tags 40 to 59 are reserved for unassigned, non-critical packets.
     * Tags 60 to 63 are non-critical private or experimental packets.
     *
     * @see 
     *     Packet Tags
     * @return true if the packet is critical, false otherwise.
     */
    public boolean isCritical()
    {
        return getPacketTag() <= 39;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy