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

SOP encrypt: match signature type when using --as= option

This commit is contained in:
Paul Schaub 2022-03-30 12:49:26 +02:00
parent 30a62daec9
commit 4782868bc1
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -60,7 +60,11 @@ public class EncryptImpl implements Encrypt {
signingOptions = SigningOptions.get();
}
try {
signingOptions.addInlineSignatures(SecretKeyRingProtector.unprotectedKeys(), keys, DocumentSignatureType.BINARY_DOCUMENT);
signingOptions.addInlineSignatures(
SecretKeyRingProtector.unprotectedKeys(),
keys,
(encryptAs == EncryptAs.Binary ? DocumentSignatureType.BINARY_DOCUMENT : DocumentSignatureType.CANONICAL_TEXT_DOCUMENT)
);
} catch (IllegalArgumentException e) {
throw new SOPGPException.KeyCannotSign();
} catch (WrongPassphraseException e) {