Package org.pgpainless.key

# Class _64DigitFingerprint

java.lang.Object
org.pgpainless.key.OpenPgpFingerprint
org.pgpainless.key._64DigitFingerprint

All Implemented Interfaces:
  `CharSequence`, `Comparable<OpenPgpFingerprint>`

Direct Known Subclasses:
  `OpenPgpV5Fingerprint`, `OpenPgpV6Fingerprint`

public class _64DigitFingerprint extends OpenPgpFingerprint
This class represents a hex encoded, upper case OpenPGP v5 or v6 fingerprint. Since both fingerprints use the same format, this class is used when parsing the fingerprint without knowing the key version.

## Field Summary

### Fields inherited from class org.pgpainless.key.OpenPgpFingerprint

`fingerprint, utf8`

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`_64DigitFingerprint(byte[] bytes)`
`protected`
`_64DigitFingerprint(String fingerprint)`
Create an `_64DigitFingerprint`.
`protected`
`_64DigitFingerprint(org.bouncycastle.openpgp.PGPKeyRing ring)`
`protected`
`_64DigitFingerprint(org.bouncycastle.openpgp.PGPPublicKey key)`
`protected`
`_64DigitFingerprint(org.bouncycastle.openpgp.PGPPublicKeyRing ring)`
`protected`
`_64DigitFingerprint(org.bouncycastle.openpgp.PGPSecretKey key)`
`protected`
`_64DigitFingerprint(org.bouncycastle.openpgp.PGPSecretKeyRing ring)`

## Method Summary

Modifier and Type
Method
Description
`int`
`compareTo(OpenPgpFingerprint openPgpFingerprint)`
`boolean`
`equals(Object other)`
`long`
`getKeyId()`
Return the key id of the OpenPGP public key this `OpenPgpFingerprint` belongs to.
`int`
`getVersion()`
Return the version of the fingerprint.
`int`
`hashCode()`
`protected boolean`
`isValid(String fp)`
Check, whether the fingerprint consists of 40 valid hexadecimal characters.
`String`
`prettyPrint()`
Return a pretty printed representation of the fingerprint.

### Methods inherited from class org.pgpainless.key.OpenPgpFingerprint

`charAt, length, of, of, of, parse, parseFromBinary, subSequence, toString`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface java.lang.CharSequence

`chars, codePoints, isEmpty`

## Constructor Details

### _64DigitFingerprint

protected _64DigitFingerprint(@Nonnull String fingerprint)
Create an `_64DigitFingerprint`.

Parameters:
  `fingerprint` - uppercase hexadecimal fingerprint of length 64

### _64DigitFingerprint

protected _64DigitFingerprint(@Nonnull byte[] bytes)

### _64DigitFingerprint

protected _64DigitFingerprint(@Nonnull org.bouncycastle.openpgp.PGPPublicKey key)

### _64DigitFingerprint

protected _64DigitFingerprint(@Nonnull org.bouncycastle.openpgp.PGPSecretKey key)

### _64DigitFingerprint

protected _64DigitFingerprint(@Nonnull org.bouncycastle.openpgp.PGPPublicKeyRing ring)

### _64DigitFingerprint

protected _64DigitFingerprint(@Nonnull org.bouncycastle.openpgp.PGPSecretKeyRing ring)

### _64DigitFingerprint

protected _64DigitFingerprint(@Nonnull org.bouncycastle.openpgp.PGPKeyRing ring)

## Method Details

### getVersion

public int getVersion()
Description copied from class: `OpenPgpFingerprint`
Return the version of the fingerprint.

Specified by:
  `getVersion` in class `OpenPgpFingerprint`
Returns:
  version

### isValid

protected boolean isValid(@Nonnull String fp)
Description copied from class: `OpenPgpFingerprint`
Check, whether the fingerprint consists of 40 valid hexadecimal characters.

Specified by:
  `isValid` in class `OpenPgpFingerprint`
Parameters:
  `fp` - fingerprint to check.
Returns:
  true if fingerprint is valid.

### getKeyId

public long getKeyId()
Description copied from class: `OpenPgpFingerprint`
Return the key id of the OpenPGP public key this `OpenPgpFingerprint` belongs to. This method can be implemented for V4 and V5 fingerprints. V3 key-IDs cannot be derived from the fingerprint, but we don't care, since V3 is deprecated.

Specified by:
  `getKeyId` in class `OpenPgpFingerprint`
Returns:
  key id
See Also:
  - RFC-4880 §12.2: Key IDs and Fingerprints

### prettyPrint

public String prettyPrint()
Description copied from class: `OpenPgpFingerprint`
Return a pretty printed representation of the fingerprint.

Specified by:
  `prettyPrint` in class `OpenPgpFingerprint`
Returns:
  pretty printed fingerprint

### equals

public boolean equals(Object other)

Overrides:
  `equals` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### compareTo

public int compareTo(OpenPgpFingerprint openPgpFingerprint)