decrypt: Do not throw NoSignature exception when verifications is empty

This commit is contained in:
Paul Schaub 2023-11-22 17:11:48 +01:00
parent 51d9c29837
commit e5e64003f3
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -85,13 +85,10 @@ class DecryptCmd : AbstractSopCmd() {
@Throws(IOException::class)
private fun writeVerifyOut(result: DecryptionResult) {
verifyOut?.let {
if (result.verifications.isEmpty()) {
val errorMsg = getMsg("sop.error.runtime.no_verifiable_signature_found")
throw NoSignature(errorMsg)
}
getOutput(verifyOut).use { out ->
PrintWriter(out).use { pw -> result.verifications.forEach { pw.println(it) } }
getOutput(it).use { out ->
PrintWriter(out).use { pw ->
result.verifications.forEach { verification -> pw.println(verification) }
}
}
}
}