mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-12-24 03:47:57 +01:00
Add utility methods to KeyRingInfo
This commit is contained in:
parent
6e1d7321db
commit
cb594c3b2c
1 changed files with 20 additions and 0 deletions
|
@ -117,6 +117,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