Package org.pgpainless.key
Class SubkeyIdentifier
- java.lang.Object
-
- org.pgpainless.key.SubkeyIdentifier
-
public class SubkeyIdentifier extends java.lang.Object
Tuple class used to identify a subkey by fingerprints of the primary key of the subkeys key ring, as well as the subkeys fingerprint.
-
-
Constructor Summary
Constructors Constructor Description SubkeyIdentifier(org.bouncycastle.openpgp.PGPKeyRing keyRing, long keyId)
Create aSubkeyIdentifier
from aPGPKeyRing
and the subkeys key id.SubkeyIdentifier(OpenPgpV4Fingerprint primaryKeyFingerprint)
Create aSubkeyIdentifier
that identifies the primary key with the given fingerprint.SubkeyIdentifier(OpenPgpV4Fingerprint primaryKeyFingerprint, OpenPgpV4Fingerprint subkeyFingerprint)
Create aSubkeyIdentifier
which points to the subkey with the given subkeyFingerprint, which has a primary key with the given primaryKeyFingerprint.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
OpenPgpV4Fingerprint
getFingerprint()
long
getKeyId()
OpenPgpV4Fingerprint
getPrimaryKeyFingerprint()
Return theOpenPgpV4Fingerprint
of the primary key of the identified key.long
getPrimaryKeyId()
Return the key id of the primary key of the identified key.OpenPgpV4Fingerprint
getSubkeyFingerprint()
Return theOpenPgpV4Fingerprint
of the identified subkey.long
getSubkeyId()
Return the key id of the identified subkey.int
hashCode()
java.lang.String
toString()
-
-
-
Constructor Detail
-
SubkeyIdentifier
public SubkeyIdentifier(@Nonnull org.bouncycastle.openpgp.PGPKeyRing keyRing, long keyId)
Create aSubkeyIdentifier
from aPGPKeyRing
and the subkeys key id.getPrimaryKeyFingerprint()
will return theOpenPgpV4Fingerprint
of the keyrings primary key, whilegetSubkeyFingerprint()
will return the subkeys fingerprint.- Parameters:
keyRing
- keyring the subkey belongs tokeyId
- keyid of the subkey
-
SubkeyIdentifier
public SubkeyIdentifier(@Nonnull OpenPgpV4Fingerprint primaryKeyFingerprint)
Create aSubkeyIdentifier
that identifies the primary key with the given fingerprint. This means, bothgetPrimaryKeyFingerprint()
andgetSubkeyFingerprint()
return the same.- Parameters:
primaryKeyFingerprint
- fingerprint of the identified key
-
SubkeyIdentifier
public SubkeyIdentifier(@Nonnull OpenPgpV4Fingerprint primaryKeyFingerprint, @Nonnull OpenPgpV4Fingerprint subkeyFingerprint)
Create aSubkeyIdentifier
which points to the subkey with the given subkeyFingerprint, which has a primary key with the given primaryKeyFingerprint.- Parameters:
primaryKeyFingerprint
- fingerprint of the primary keysubkeyFingerprint
- fingerprint of the subkey
-
-
Method Detail
-
getFingerprint
@Nonnull public OpenPgpV4Fingerprint getFingerprint()
-
getKeyId
public long getKeyId()
-
getPrimaryKeyFingerprint
@Nonnull public OpenPgpV4Fingerprint getPrimaryKeyFingerprint()
Return theOpenPgpV4Fingerprint
of the primary key of the identified key. This might be the same asgetSubkeyFingerprint()
if the identified subkey is the primary key.- Returns:
- primary key fingerprint
-
getPrimaryKeyId
public long getPrimaryKeyId()
Return the key id of the primary key of the identified key. This might be the same asgetSubkeyId()
if the identified subkey is the primary key.- Returns:
- primary key id
-
getSubkeyFingerprint
@Nonnull public OpenPgpV4Fingerprint getSubkeyFingerprint()
Return theOpenPgpV4Fingerprint
of the identified subkey.- Returns:
- subkey fingerprint
-
getSubkeyId
public long getSubkeyId()
Return the key id of the identified subkey.- Returns:
- subkey id
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-