1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-23 04:42:06 +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(); signingOptions = SigningOptions.get();
} }
try { 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) { } catch (IllegalArgumentException e) {
throw new SOPGPException.KeyCannotSign(); throw new SOPGPException.KeyCannotSign();
} catch (WrongPassphraseException e) { } catch (WrongPassphraseException e) {