| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private BCPGKey | |
| public static final int | LIBREPGP_5
Non-Standard LibrePGP introduced v5, which is only supported by a subset of vendors. |
| private long | |
| private int | |
| private int | |
| public static final int | VERSION_3
OpenPGP v3 keys are deprecated. |
| public static final int | VERSION_4
OpenPGP v4 keys are (at the time of writing) widely used, but are subject to some attacks. |
| public static final int | VERSION_6
OpenPGP v6 keys are newly introduced. |
| Access | Constructor and Description |
|---|---|
| pack-priv | PublicKeyPacket(BCPGInputStream
packet input stream in)Parse a |
| pack-priv | PublicKeyPacket(BCPGInputStream
packet input stream in, boolean new packet format newPacketFormat)Parse a |
| pack-priv | PublicKeyPacket(int
packet type ID keyTag, BCPGInputStream packet input stream in)Parse a |
| pack-priv | PublicKeyPacket(int
packet type ID keyTag, BCPGInputStream packet input stream in, boolean packet format newPacketFormat)Parse a |
| public | PublicKeyPacket(int
public key algorithm id algorithm, Date creation time time, BCPGKey key object key)
Deprecated
use versioned
PublicKeyPacket(int, int, Date, BCPGKey) instead
Construct version 4 public primary key packet. |
| public | PublicKeyPacket(int
packet version version, int public key algorithm id algorithm, Date creation time time, BCPGKey key object key)Construct an OpenPGP public primary key packet. |
| pack-priv | PublicKeyPacket(int
public key packet type ID keyTag, int packet version version, int public key algorithm id algorithm, Date creation time time, BCPGKey key object key)Construct an OpenPGP public key packet. |
| Modifier and Type | Method and Description |
|---|---|
| public void | encode(BCPGOutputStream
packet output stream out)Implements abstract org. Encode the packet to the OpenPGP |
| public int | |
| public byte[] | Returns: encoded packet contentsReturn the encoded packet contents without the packet frame. |
| public BCPGKey | |
| public static long | |
| public Date | |
| public int | Returns: v3 key validity period in days since creation.
Deprecated
v4 and v6 keys instead signal their expiration time via the
org. signature subpacket.
Only for v3 keys - The time in days since the keys creation, during which the key is valid. |
| public int | |
| private void | parseKey(BCPGInputStream
input stream which read just up to the public key material in, int public key algorithm ID algorithmId, long optional: Length of the public key material. -1 if not present. optLen)Parse algorithm-specific public key material. |
| algorithm | back to summary |
|---|---|
| private int algorithm | |
| key | back to summary |
|---|---|
| private BCPGKey key | |
| LIBREPGP_5 | back to summary |
|---|---|
| public static final int LIBREPGP_5 Non-Standard LibrePGP introduced v5, which is only supported by a subset of vendors. | |
| time | back to summary |
|---|---|
| private long time | |
| validDays | back to summary |
|---|---|
| private int validDays | |
| version | back to summary |
|---|---|
| private int version | |
| VERSION_3 | back to summary |
|---|---|
| public static final int VERSION_3 OpenPGP v3 keys are deprecated. They can only be used with RSA.
| |
| VERSION_4 | back to summary |
|---|---|
| public static final int VERSION_4 OpenPGP v4 keys are (at the time of writing) widely used, but are subject to some attacks.
| |
| VERSION_6 | back to summary |
|---|---|
| public static final int VERSION_6 OpenPGP v6 keys are newly introduced.
| |
| PublicKeyPacket | back to summary |
|---|---|
| pack-priv PublicKeyPacket(BCPGInputStream in) throws IOException Parse a
| |
| PublicKeyPacket | back to summary |
|---|---|
| pack-priv PublicKeyPacket(BCPGInputStream in, boolean newPacketFormat) throws IOException Parse a newPacketFormatis true, the packet format is remembered as PacketFormat#CURRENT,
otherwise as PacketFormat#LEGACY.
| |
| PublicKeyPacket | back to summary |
|---|---|
| pack-priv PublicKeyPacket(int keyTag, BCPGInputStream in) throws IOException Parse a keyTagis PUBLIC_KEY, the packet is a primary key.
If instead it is PUBLIC_SUBKEY, it is a subkey packet.
The packet format is remembered as PacketFormat#LEGACY.
| |
| PublicKeyPacket | back to summary |
|---|---|
| pack-priv PublicKeyPacket(int keyTag, BCPGInputStream in, boolean newPacketFormat) throws IOException Parse a keyTagis PUBLIC_KEY, the packet is a primary key.
If instead it is PUBLIC_SUBKEY, it is a subkey packet.
If newPacketFormatis true, the packet format is remembered as PacketFormat#CURRENT,
otherwise as PacketFormat#LEGACY.
| |
| PublicKeyPacket | back to summary |
|---|---|
| public PublicKeyPacket(int algorithm, Date time, BCPGKey key)
Deprecated use versioned Construct version 4 public primary key packet.
| |
| PublicKeyPacket | back to summary |
|---|---|
| public PublicKeyPacket(int version, int algorithm, Date time, BCPGKey key) Construct an OpenPGP public primary key packet. | |
| PublicKeyPacket | back to summary |
|---|---|
| pack-priv PublicKeyPacket(int keyTag, int version, int algorithm, Date time, BCPGKey key) Construct an OpenPGP public key packet. If keyTagis PUBLIC_KEY, the packet is a primary key.
If instead it is PUBLIC_SUBKEY, it is a subkey packet.
| |
| encode | back to summary |
|---|---|
| public void encode(BCPGOutputStream out) throws IOException Implements abstract org. Encode the packet to the OpenPGP
| |
| getAlgorithm | back to summary |
|---|---|
| public int getAlgorithm() Return the
| |
| getEncodedContents | back to summary |
|---|---|
| public byte[] getEncodedContents() throws IOException Return the encoded packet contents without the packet frame.
| |
| getKey | back to summary |
|---|---|
| public BCPGKey getKey() Return the key object.
| |
| getKeyID | back to summary |
|---|---|
| public static long getKeyID(PublicKeyPacket publicPk, byte[] fingerprint) | |
| getTime | back to summary |
|---|---|
| public Date getTime() Return the keys creation time.
| |
| getValidDays | back to summary |
|---|---|
| public int getValidDays()
Deprecated v4 and v6 keys instead signal their expiration time via the
Only for v3 keys - The time in days since the keys creation, during which the key is valid.
| |
| getVersion | back to summary |
|---|---|
| public int getVersion() Return the packet version.
| |
| parseKey | back to summary |
|---|---|
| private void parseKey(BCPGInputStream in, int algorithmId, long optLen) throws IOException Parse algorithm-specific public key material.
| |