HomeiOS Developmentios - Apple in app buy: The Token's Signature resulted invalid when...

ios – Apple in app buy: The Token’s Signature resulted invalid when verified utilizing the Algorithm: SHA256withECDSA


I’m utilizing this library from apple to confirm a transaction made with Apple in-app buy:
https://github.com/apple/app-store-server-library-java

I’ve a sound signed transaction, after I use the SignedDataVerifier, it throws
SignatureVerificationException: The Token's Signature resulted invalid when verified utilizing the Algorithm: SHA256withECDSA

Right here is my code:

enjoyable verifyCertificate() {
        val bundleId = "my bundle id"
        val surroundings = Atmosphere.SANDBOX
        val rootCAs = mutableSetOf(
            computerCert.inputStream,
            incCert.inputStream,
            g2cert.inputStream,
            g3cert.inputStream
        )

        val signedDataVerifier  = SignedDataVerifier(rootCAs, bundleId, null, surroundings, false)

        val signedTransaction = "eyJhbGci..."
        strive {
            val transaction = signedDataVerifier .verifyAndDecodeTransaction(signedTransaction )
            println(transaction)
        } catch (e: VerificationException) {
            e.printStackTrace()
        }
    }

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments