|
Bouncy Castle Cryptography Library 1.79 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.bouncycastle.bcpg.Packet | +--org.bouncycastle.bcpg.ContainedPacket | +--org.bouncycastle.bcpg.PublicKeyPacket
Base class for OpenPGP public (primary) keys. The public key packet holds the public parameters of an OpenPGP key pair. An OpenPGP certificate (transferable public key) consists of one primary key and optionally multiple subkey packets.
Field Summary | |
static int |
LIBREPGP_5
Non-Standard LibrePGP introduced v5, which is only supported by a subset of vendors. |
static int |
VERSION_3
OpenPGP v3 keys are deprecated. |
static int |
VERSION_4
OpenPGP v4 keys are (at the time of writing) widely used, but are subject to some attacks. |
static int |
VERSION_6
OpenPGP v6 keys are newly introduced. |
Fields inherited from interface org.bouncycastle.bcpg.PublicKeyAlgorithmTags |
AEDH, AEDSA, DIFFIE_HELLMAN, DSA, EC, ECDH, ECDSA, Ed25519, Ed448, EDDSA, EDDSA_LEGACY, ELGAMAL_ENCRYPT, ELGAMAL_GENERAL, EXPERIMENTAL_1, EXPERIMENTAL_10, EXPERIMENTAL_11, EXPERIMENTAL_2, EXPERIMENTAL_3, EXPERIMENTAL_4, EXPERIMENTAL_5, EXPERIMENTAL_6, EXPERIMENTAL_7, EXPERIMENTAL_8, EXPERIMENTAL_9, RSA_ENCRYPT, RSA_GENERAL, RSA_SIGN, X25519, X448 |
Fields inherited from interface org.bouncycastle.bcpg.PacketTags |
AEAD_ENC_DATA, COMPRESSED_DATA, EXPERIMENTAL_1, EXPERIMENTAL_2, EXPERIMENTAL_3, EXPERIMENTAL_4, LITERAL_DATA, MARKER, MOD_DETECTION_CODE, ONE_PASS_SIGNATURE, PADDING, PUBLIC_KEY, PUBLIC_KEY_ENC_SESSION, PUBLIC_SUBKEY, RESERVED, SECRET_KEY, SECRET_SUBKEY, SIGNATURE, SYM_ENC_INTEGRITY_PRO, SYMMETRIC_KEY_ENC, SYMMETRIC_KEY_ENC_SESSION, TRUST, USER_ATTRIBUTE, USER_ID |
Constructor Summary | |
PublicKeyPacket(int algorithm,
java.util.Date time,
BCPGKey key)
Deprecated. use versioned PublicKeyPacket(int, int, Date, BCPGKey) instead |
|
PublicKeyPacket(int version,
int algorithm,
java.util.Date time,
BCPGKey key)
Construct an OpenPGP public primary key packet. |
Method Summary | |
void |
encode(BCPGOutputStream out)
Encode the packet to the OpenPGP BCPGOutputStream . |
int |
getAlgorithm()
Return the algorithm id of the public key. |
byte[] |
getEncodedContents()
Return the encoded packet contents without the packet frame. |
BCPGKey |
getKey()
Return the key object. |
static long |
getKeyID(PublicKeyPacket publicPk,
byte[] fingerprint)
|
java.util.Date |
getTime()
Return the keys creation time. |
int |
getValidDays()
Deprecated. v4 and v6 keys instead signal their expiration time via the KeyExpirationTime signature subpacket. |
int |
getVersion()
Return the packet version. |
Methods inherited from class org.bouncycastle.bcpg.ContainedPacket |
getEncoded, getEncoded |
Methods inherited from class org.bouncycastle.bcpg.Packet |
getPacketTag, hasNewPacketFormat, isCritical |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int VERSION_3
public static final int VERSION_4
public static final int LIBREPGP_5
public static final int VERSION_6
Constructor Detail |
public PublicKeyPacket(int algorithm, java.util.Date time, BCPGKey key)
PublicKeyPacket(int, int, Date, BCPGKey)
instead
algorithm
- public key algorithm idtime
- creation timekey
- key objectpublic PublicKeyPacket(int version, int algorithm, java.util.Date time, BCPGKey key)
version
- packet versionalgorithm
- public key algorithm idtime
- creation timekey
- key objectMethod Detail |
public int getVersion()
public int getAlgorithm()
algorithm id
of the public key.public int getValidDays()
KeyExpirationTime
signature subpacket.
public java.util.Date getTime()
public BCPGKey getKey()
public byte[] getEncodedContents() throws java.io.IOException
java.io.IOException
- public void encode(BCPGOutputStream out) throws java.io.IOException
BCPGOutputStream
.
If the BCPGOutputStream
packet format is set to PacketFormat.ROUNDTRIP
, the result
of Packet.hasNewPacketFormat()
determines, which packet format is used to encode the packet.
Otherwise, the BCPGOutputStream
dictates which format to use.encode
in class ContainedPacket
out
- packet output streamjava.io.IOException
- public static long getKeyID(PublicKeyPacket publicPk, byte[] fingerprint)
|
Bouncy Castle Cryptography Library 1.79 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |