mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-12-06 20:31:08 +01:00
Add more tests for V6 fingerprints
This commit is contained in:
parent
15af265e3f
commit
8cdb7ee4e0
2 changed files with 85 additions and 0 deletions
|
|
@ -10,6 +10,7 @@ import javax.annotation.Nonnull;
|
|||
import org.bouncycastle.openpgp.PGPKeyRing;
|
||||
import org.bouncycastle.openpgp.PGPPublicKey;
|
||||
import org.bouncycastle.openpgp.PGPPublicKeyRing;
|
||||
import org.bouncycastle.openpgp.PGPSecretKey;
|
||||
import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
||||
import org.bouncycastle.util.encoders.Hex;
|
||||
|
||||
|
|
@ -22,6 +23,17 @@ public abstract class OpenPgpFingerprint implements CharSequence, Comparable<Ope
|
|||
protected static final Charset utf8 = Charset.forName("UTF-8");
|
||||
protected final String fingerprint;
|
||||
|
||||
/**
|
||||
* Return the fingerprint of the given key.
|
||||
* This method automatically matches key versions to fingerprint implementations.
|
||||
*
|
||||
* @param key key
|
||||
* @return fingerprint
|
||||
*/
|
||||
public static OpenPgpFingerprint of(PGPSecretKey key) {
|
||||
return of(key.getPublicKey());
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the fingerprint of the given key.
|
||||
* This method automatically matches key versions to fingerprint implementations.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue