public final class PGPSecretKeyUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
fingerprint(org.bouncycastle.openpgp.PGPSecretKey secretKey)
Generate string version of key fingerprint
|
static String |
getKeyId(org.bouncycastle.openpgp.PGPSecretKey secretKey)
Generate keyId as hex string.
|
static Optional<org.bouncycastle.openpgp.PGPSecretKey> |
getMasterKey(org.bouncycastle.openpgp.PGPSecretKey secretKey,
org.bouncycastle.openpgp.PGPSecretKeyRing secretKeyRing)
Return master key for given sub public key.
|
static Collection<String> |
getUserIDs(org.bouncycastle.openpgp.PGPSecretKey secretKey,
org.bouncycastle.openpgp.PGPSecretKeyRing secretKeyRing)
List of user ids from secret key.
|
static String |
keyIdDescription(org.bouncycastle.openpgp.PGPSecretKey secretKey,
org.bouncycastle.openpgp.PGPSecretKeyRing secretKeyRing)
Generate string with key id description.
|
static void |
verifyKeyExpiration(org.bouncycastle.openpgp.PGPSecretKey secretKey,
org.bouncycastle.openpgp.PGPSecretKeyRing secretKeyRing)
Verify expiration time of secret key.
|
public static String getKeyId(org.bouncycastle.openpgp.PGPSecretKey secretKey)
secretKey - a key to print idpublic static Collection<String> getUserIDs(org.bouncycastle.openpgp.PGPSecretKey secretKey, org.bouncycastle.openpgp.PGPSecretKeyRing secretKeyRing)
secretKey - a secret key for user idssecretKeyRing - a keyRing of connected keys - need for sub keypublic static String keyIdDescription(org.bouncycastle.openpgp.PGPSecretKey secretKey, org.bouncycastle.openpgp.PGPSecretKeyRing secretKeyRing)
secretKey - given keysecretKeyRing - keys ring with master and sub keyspublic static Optional<org.bouncycastle.openpgp.PGPSecretKey> getMasterKey(org.bouncycastle.openpgp.PGPSecretKey secretKey, org.bouncycastle.openpgp.PGPSecretKeyRing secretKeyRing)
secretKey - given keysecretKeyRing - keys ring with master and sub keyspublic static String fingerprint(org.bouncycastle.openpgp.PGPSecretKey secretKey)
secretKey - given keypublic static void verifyKeyExpiration(org.bouncycastle.openpgp.PGPSecretKey secretKey,
org.bouncycastle.openpgp.PGPSecretKeyRing secretKeyRing)
secretKey - a key to checksecretKeyRing - a keyRing used for prepare messagePGPSignerException - if key expiredCopyright © 2020–2021 Simplify4U. All rights reserved.