1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2025-12-10 22:31:09 +01:00

Add tests for KeyRingUtils.deleteUserIdFrom*KeyRing methods

This commit is contained in:
Paul Schaub 2021-11-12 16:49:28 +01:00
parent 0f77d81bd1
commit d036cf2593
2 changed files with 55 additions and 2 deletions

View file

@ -167,7 +167,7 @@ public final class KeyRingUtils {
* @return modified secret keys
*/
@Deprecated
public PGPSecretKeyRing deleteUserIdFromSecretKeyRing(PGPSecretKeyRing secretKeys, String userId) {
public static PGPSecretKeyRing deleteUserIdFromSecretKeyRing(PGPSecretKeyRing secretKeys, String userId) {
PGPSecretKey secretKey = secretKeys.getSecretKey(); // user-ids are located on primary key only
PGPPublicKey publicKey = secretKey.getPublicKey(); // user-ids are placed on the public key part
publicKey = PGPPublicKey.removeCertification(publicKey, userId);
@ -191,7 +191,7 @@ public final class KeyRingUtils {
* @return modified secret keys
*/
@Deprecated
public PGPPublicKeyRing deleteUserIdFromPublicKeyRing(PGPPublicKeyRing publicKeys, String userId) {
public static PGPPublicKeyRing deleteUserIdFromPublicKeyRing(PGPPublicKeyRing publicKeys, String userId) {
PGPPublicKey publicKey = publicKeys.getPublicKey(); // user-ids are located on primary key only
publicKey = PGPPublicKey.removeCertification(publicKey, userId);
if (publicKey == null) {