Package org.pgpainless.key
Class OpenPgpV4Fingerprint
java.lang.Object
org.pgpainless.key.OpenPgpFingerprint
org.pgpainless.key.OpenPgpV4Fingerprint
- All Implemented Interfaces:
CharSequence,Comparable<OpenPgpFingerprint>
This class represents a hex encoded, uppercase OpenPGP v4 fingerprint.
-
Field Summary
FieldsFields inherited from class org.pgpainless.key.OpenPgpFingerprint
fingerprint, utf8 -
Constructor Summary
ConstructorsConstructorDescriptionOpenPgpV4Fingerprint(byte[] bytes) OpenPgpV4Fingerprint(String fingerprint) Create anOpenPgpV4Fingerprint.OpenPgpV4Fingerprint(org.bouncycastle.openpgp.PGPKeyRing ring) OpenPgpV4Fingerprint(org.bouncycastle.openpgp.PGPPublicKey key) OpenPgpV4Fingerprint(org.bouncycastle.openpgp.PGPPublicKeyRing ring) OpenPgpV4Fingerprint(org.bouncycastle.openpgp.PGPSecretKey key) OpenPgpV4Fingerprint(org.bouncycastle.openpgp.PGPSecretKeyRing ring) -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(OpenPgpFingerprint openPgpFingerprint) booleanstatic OpenPgpV4FingerprintConvert an openpgp4fpr URI to anOpenPgpV4Fingerprint.longgetKeyId()Return the key id of the OpenPGP public key thisOpenPgpFingerprintbelongs to.intReturn the version of the fingerprint.inthashCode()protected booleanCheck, whether the fingerprint consists of 40 valid hexadecimal characters.Return a pretty printed representation of the fingerprint.toUri()Return the fingerprint as an openpgp4fprURI.Methods inherited from class org.pgpainless.key.OpenPgpFingerprint
charAt, length, of, of, of, parse, parseFromBinary, subSequence, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.CharSequence
chars, codePoints, isEmpty
-
Field Details
-
SCHEME
- See Also:
-
-
Constructor Details
-
OpenPgpV4Fingerprint
Create anOpenPgpV4Fingerprint.- Parameters:
fingerprint- uppercase hexadecimal fingerprint of length 40
-
OpenPgpV4Fingerprint
public OpenPgpV4Fingerprint(@Nonnull byte[] bytes) -
OpenPgpV4Fingerprint
public OpenPgpV4Fingerprint(@Nonnull org.bouncycastle.openpgp.PGPPublicKey key) -
OpenPgpV4Fingerprint
public OpenPgpV4Fingerprint(@Nonnull org.bouncycastle.openpgp.PGPSecretKey key) -
OpenPgpV4Fingerprint
public OpenPgpV4Fingerprint(@Nonnull org.bouncycastle.openpgp.PGPPublicKeyRing ring) -
OpenPgpV4Fingerprint
public OpenPgpV4Fingerprint(@Nonnull org.bouncycastle.openpgp.PGPSecretKeyRing ring) -
OpenPgpV4Fingerprint
public OpenPgpV4Fingerprint(@Nonnull org.bouncycastle.openpgp.PGPKeyRing ring)
-
-
Method Details
-
getVersion
public int getVersion()Description copied from class:OpenPgpFingerprintReturn the version of the fingerprint.- Specified by:
getVersionin classOpenPgpFingerprint- Returns:
- version
-
isValid
Description copied from class:OpenPgpFingerprintCheck, whether the fingerprint consists of 40 valid hexadecimal characters.- Specified by:
isValidin classOpenPgpFingerprint- Parameters:
fp- fingerprint to check.- Returns:
- true if fingerprint is valid.
-
getKeyId
public long getKeyId()Description copied from class:OpenPgpFingerprintReturn the key id of the OpenPGP public key thisOpenPgpFingerprintbelongs 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:
getKeyIdin classOpenPgpFingerprint- Returns:
- key id
- See Also:
-
prettyPrint
Description copied from class:OpenPgpFingerprintReturn a pretty printed representation of the fingerprint.- Specified by:
prettyPrintin classOpenPgpFingerprint- Returns:
- pretty printed fingerprint
-
equals
-
hashCode
public int hashCode() -
toUri
Return the fingerprint as an openpgp4fprURI. An example would be 'openpgp4fpr:7F9116FEA90A5983936C7CFAA027DB2F3E1E118A'.- Returns:
- openpgp4fpr fingerprint uri
- See Also:
-
fromUri
Convert an openpgp4fpr URI to anOpenPgpV4Fingerprint.- Parameters:
uri-URIwith scheme 'openpgp4fpr'- Returns:
- fingerprint parsed from the uri
- See Also:
-
compareTo
-