Package org.pgpainless.key
Class OpenPgpV5Fingerprint
- java.lang.Object
-
- org.pgpainless.key.OpenPgpFingerprint
-
- org.pgpainless.key.OpenPgpV5Fingerprint
-
- All Implemented Interfaces:
java.lang.CharSequence
,java.lang.Comparable<OpenPgpFingerprint>
public class OpenPgpV5Fingerprint extends OpenPgpFingerprint
This class represents a hex encoded, upper case OpenPGP v5 fingerprint.
-
-
Field Summary
-
Fields inherited from class org.pgpainless.key.OpenPgpFingerprint
fingerprint, utf8
-
-
Constructor Summary
Constructors Constructor Description OpenPgpV5Fingerprint(byte[] bytes)
OpenPgpV5Fingerprint(java.lang.String fingerprint)
Create anOpenPgpV5Fingerprint
.OpenPgpV5Fingerprint(org.bouncycastle.openpgp.PGPKeyRing ring)
OpenPgpV5Fingerprint(org.bouncycastle.openpgp.PGPPublicKey key)
OpenPgpV5Fingerprint(org.bouncycastle.openpgp.PGPPublicKeyRing ring)
OpenPgpV5Fingerprint(org.bouncycastle.openpgp.PGPSecretKey key)
OpenPgpV5Fingerprint(org.bouncycastle.openpgp.PGPSecretKeyRing ring)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(OpenPgpFingerprint openPgpFingerprint)
boolean
equals(java.lang.Object other)
long
getKeyId()
Return the key id of the OpenPGP public key thisOpenPgpFingerprint
belongs to.int
getVersion()
Return the version of the fingerprint.int
hashCode()
protected boolean
isValid(java.lang.String fp)
Check, whether the fingerprint consists of 40 valid hexadecimal characters.java.lang.String
prettyPrint()
Return a pretty printed representation of the fingerprint.-
Methods inherited from class org.pgpainless.key.OpenPgpFingerprint
charAt, length, of, of, parse, parseFromBinary, subSequence, toString
-
-
-
-
Constructor Detail
-
OpenPgpV5Fingerprint
public OpenPgpV5Fingerprint(@Nonnull java.lang.String fingerprint)
Create anOpenPgpV5Fingerprint
.- Parameters:
fingerprint
- uppercase hexadecimal fingerprint of length 64
-
OpenPgpV5Fingerprint
public OpenPgpV5Fingerprint(@Nonnull byte[] bytes)
-
OpenPgpV5Fingerprint
public OpenPgpV5Fingerprint(@Nonnull org.bouncycastle.openpgp.PGPPublicKey key)
-
OpenPgpV5Fingerprint
public OpenPgpV5Fingerprint(@Nonnull org.bouncycastle.openpgp.PGPSecretKey key)
-
OpenPgpV5Fingerprint
public OpenPgpV5Fingerprint(@Nonnull org.bouncycastle.openpgp.PGPPublicKeyRing ring)
-
OpenPgpV5Fingerprint
public OpenPgpV5Fingerprint(@Nonnull org.bouncycastle.openpgp.PGPSecretKeyRing ring)
-
OpenPgpV5Fingerprint
public OpenPgpV5Fingerprint(@Nonnull org.bouncycastle.openpgp.PGPKeyRing ring)
-
-
Method Detail
-
getVersion
public int getVersion()
Description copied from class:OpenPgpFingerprint
Return the version of the fingerprint.- Specified by:
getVersion
in classOpenPgpFingerprint
- Returns:
- version
-
isValid
protected boolean isValid(@Nonnull java.lang.String fp)
Description copied from class:OpenPgpFingerprint
Check, whether the fingerprint consists of 40 valid hexadecimal characters.- Specified by:
isValid
in classOpenPgpFingerprint
- 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 thisOpenPgpFingerprint
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 classOpenPgpFingerprint
- Returns:
- key id
- See Also:
- RFC-4880 ยง12.2: Key IDs and Fingerprints
-
prettyPrint
public java.lang.String prettyPrint()
Description copied from class:OpenPgpFingerprint
Return a pretty printed representation of the fingerprint.- Specified by:
prettyPrint
in classOpenPgpFingerprint
- Returns:
- pretty printed fingerprint
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
compareTo
public int compareTo(OpenPgpFingerprint openPgpFingerprint)
-
-