mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-12-22 19:08:00 +01:00
Add utility methods to KeyRingInfo
This commit is contained in:
parent
30481cd510
commit
172972fe29
1 changed files with 20 additions and 0 deletions
|
@ -118,6 +118,26 @@ public class KeyRingInfo {
|
|||
this.revocationState = findRevocationState();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the underlying {@link PGPKeyRing}.
|
||||
* @return keys
|
||||
*/
|
||||
public PGPKeyRing getKeys() {
|
||||
return keys;
|
||||
}
|
||||
|
||||
public List<PGPPublicKey> getValidSubkeys() {
|
||||
List<PGPPublicKey> subkeys = new ArrayList<>();
|
||||
Iterator<PGPPublicKey> iterator = getKeys().getPublicKeys();
|
||||
while (iterator.hasNext()) {
|
||||
PGPPublicKey key = iterator.next();
|
||||
if (isKeyValidlyBound(key.getKeyID())) {
|
||||
subkeys.add(key);
|
||||
}
|
||||
}
|
||||
return subkeys;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
private RevocationState findRevocationState() {
|
||||
PGPSignature revocation = signatures.primaryKeyRevocation;
|
||||
|
|
Loading…
Reference in a new issue