1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-26 22:32:07 +01:00

RevocationSignatureBuilder: Allow for generation of external revocation signatures

This commit is contained in:
Paul Schaub 2022-01-04 17:22:45 +01:00
parent 5884c4afcd
commit 88e3c61b20

View file

@ -52,8 +52,8 @@ public class RevocationSignatureBuilder extends AbstractSignatureBuilder<Revocat
public PGPSignature build(PGPPublicKey revokeeSubkey) throws PGPException {
PGPSignatureGenerator signatureGenerator = buildAndInitSignatureGenerator();
if (signatureType == SignatureType.KEY_REVOCATION) {
if (revokeeSubkey.getKeyID() != publicSigningKey.getKeyID()) {
throw new IllegalArgumentException("Signature type is KEY_REVOCATION, but provided revokeeSubkey is != signingPublicKey.");
if (!revokeeSubkey.isMasterKey()) {
throw new IllegalArgumentException("Signature type is KEY_REVOCATION, but provided revokeeSubkey does not appear to be a primary key.");
}
return signatureGenerator.generateCertification(publicSigningKey);
} else {