in lib/src/main/kotlin/org/jetbrains/zip/signer/signing/DefaultSignatureProvider.kt [13:27]
override fun sign(dataToSign: ByteArray): ByteArray {
return try {
with(signature) {
initSign(privateKey)
update(dataToSign)
sign()
}
} catch (e: InvalidKeyException) {
throw InvalidKeyException("Failed to sign using $jcaSignatureAlgorithm", e)
} catch (e: InvalidAlgorithmParameterException) {
throw SignatureException("Failed to sign using $jcaSignatureAlgorithm", e)
} catch (e: SignatureException) {
throw SignatureException("Failed to sign using $jcaSignatureAlgorithm", e)
}
}