PgpPublicKeyParser: Cast Any? signature to PGPSignature

This commit is contained in:
Alva Swanson 2023-08-23 14:56:38 +02:00
parent 34d61d1f56
commit 16d33f885e
No known key found for this signature in database
GPG Key ID: 004760E77F753090

View File

@ -2,6 +2,7 @@ package bisq.gradle.tasks.signature
import org.bouncycastle.openpgp.PGPPublicKey import org.bouncycastle.openpgp.PGPPublicKey
import org.bouncycastle.openpgp.PGPPublicKeyRing import org.bouncycastle.openpgp.PGPPublicKeyRing
import org.bouncycastle.openpgp.PGPSignature
import org.bouncycastle.openpgp.PGPUtil import org.bouncycastle.openpgp.PGPUtil
import org.bouncycastle.openpgp.jcajce.JcaPGPPublicKeyRingCollection import org.bouncycastle.openpgp.jcajce.JcaPGPPublicKeyRingCollection
import org.bouncycastle.openpgp.operator.jcajce.JcaPGPContentVerifierBuilderProvider import org.bouncycastle.openpgp.operator.jcajce.JcaPGPContentVerifierBuilderProvider
@ -75,7 +76,8 @@ class PpgPublicKeyParser(
private fun verifySubKeySignatures() { private fun verifySubKeySignatures() {
subKeys.forEach { subKey -> subKeys.forEach { subKey ->
var hasValidSignature = false var hasValidSignature = false
subKey.keySignatures.forEach { signature -> subKey.keySignatures.forEach { anySignature: Any? ->
val signature = anySignature as PGPSignature
signature.init( signature.init(
JcaPGPContentVerifierBuilderProvider().setProvider("BC"), JcaPGPContentVerifierBuilderProvider().setProvider("BC"),
masterKey!! masterKey!!
@ -92,4 +94,4 @@ class PpgPublicKeyParser(
} }
} }
} }
} }