1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-23 12:52:07 +01:00

Add convenience method to delete userIds from the primary key

This commit is contained in:
Paul Schaub 2021-02-03 16:31:45 +01:00
parent 449881bd8d
commit 138ea0d572
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
2 changed files with 12 additions and 0 deletions

View file

@ -147,6 +147,12 @@ public class SecretKeyRingEditor implements SecretKeyRingEditorInterface {
return deleteUserId(publicKey.getKeyID(), userId, protector);
}
@Override
public SecretKeyRingEditorInterface deleteUserIds(UserIdSelectionStrategy selectionStrategy, SecretKeyRingProtector secretKeyRingProtector) {
PGPPublicKey publicKey = secretKeyRing.getPublicKey();
return deleteUserIds(publicKey.getKeyID(), selectionStrategy, secretKeyRingProtector);
}
@Override
public SecretKeyRingEditorInterface deleteUserIds(long keyId, UserIdSelectionStrategy selectionStrategy, SecretKeyRingProtector secretKeyRingProtector) {
List<PGPPublicKey> publicKeys = new ArrayList<>();

View file

@ -80,6 +80,12 @@ public interface SecretKeyRingEditorInterface {
return deleteUserIds(keyId, UserIdSelectionStrategy.exactMatch(userId), secretKeyRingProtector);
}
SecretKeyRingEditorInterface deleteUserIds(UserIdSelectionStrategy selectionStrategy, SecretKeyRingProtector secretKeyRingProtector);
default SecretKeyRingEditorInterface deleteUserIds(OpenPgpV4Fingerprint fingerprint, UserIdSelectionStrategy selectionStrategy, SecretKeyRingProtector secretKeyRingProtector) {
return deleteUserIds(fingerprint.getKeyId(), selectionStrategy, secretKeyRingProtector);
}
SecretKeyRingEditorInterface deleteUserIds(long keyId, UserIdSelectionStrategy selectionStrategy, SecretKeyRingProtector secretKeyRingProtector);
/**