1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-17 18:02:05 +01:00

Add KeyRingUtils.injectCertification(keys, certification)

This commit is contained in:
Paul Schaub 2022-09-05 15:15:58 +02:00
parent 5be42b22bd
commit cd0b9603e7
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -238,7 +238,21 @@ public final class KeyRingUtils {
}
/**
* Inject a key certification into the given key ring.
* Inject a key certification for the primary key into the given key ring.
*
* @param keyRing key ring
* @param certification key signature
* @return key ring with injected signature
* @param <T> either {@link PGPPublicKeyRing} or {@link PGPSecretKeyRing}
*/
@Nonnull
public static <T extends PGPKeyRing> T injectCertification(@Nonnull T keyRing,
@Nonnull PGPSignature certification) {
return injectCertification(keyRing, keyRing.getPublicKey(), certification);
}
/**
* Inject a key certification for the given key into the given key ring.
*
* @param keyRing key ring
* @param certifiedKey signed public key