Class 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 Detail

      • SubkeyIdentifier

        public SubkeyIdentifier​(org.bouncycastle.openpgp.PGPKeyRing keyRing)
        Create a SubkeyIdentifier from a PGPKeyRing. The identifier will point to the primary key of the provided ring.
        Parameters:
        keyRing - key ring
      • SubkeyIdentifier

        public SubkeyIdentifier​(@Nonnull
                                org.bouncycastle.openpgp.PGPKeyRing keyRing,
                                long keyId)
        Create a SubkeyIdentifier from a PGPKeyRing and the subkeys key id. getPrimaryKeyFingerprint() will return the OpenPgpV4Fingerprint of the keyrings primary key, while getSubkeyFingerprint() will return the subkeys fingerprint.
        Parameters:
        keyRing - keyring the subkey belongs to
        keyId - keyid of the subkey
      • SubkeyIdentifier

        public SubkeyIdentifier​(@Nonnull
                                org.bouncycastle.openpgp.PGPKeyRing keyRing,
                                @Nonnull
                                OpenPgpV4Fingerprint subkeyFingerprint)
      • SubkeyIdentifier

        public SubkeyIdentifier​(@Nonnull
                                OpenPgpV4Fingerprint primaryKeyFingerprint,
                                @Nonnull
                                OpenPgpV4Fingerprint subkeyFingerprint)
        Create a SubkeyIdentifier which points to the subkey with the given subkeyFingerprint, which has a primary key with the given primaryKeyFingerprint.
        Parameters:
        primaryKeyFingerprint - fingerprint of the primary key
        subkeyFingerprint - fingerprint of the subkey
    • Method Detail

      • getKeyId

        public long getKeyId()
      • getPrimaryKeyId

        public long getPrimaryKeyId()
        Return the key id of the primary key of the identified key. This might be the same as getSubkeyId() if the identified subkey is the primary key.
        Returns:
        primary key id
      • getSubkeyId

        public long getSubkeyId()
        Return the key id of the identified subkey.
        Returns:
        subkey id
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object