admin管理员组

文章数量:1124408

I want to do a Direct decryption using the Tink library but it says "cannot verify signature" I generated the key pair using the following "guide" I registered the public key in the google pay & wallet console

also I implemented the snipplet in the page like this:

GooglePaymentsPublicKeysManager.INSTANCE_TEST.refreshInBackground();
String decryptedMessage =
new PaymentMethodTokenRecipient.Builder()
.fetchSenderVerifyingKeysWith(GooglePaymentsPublicKeysManager.INSTANCE_TEST)
.recipientId("merchant:MerchantId")
.protocolVersion("ECv2")
.addRecipientPrivateKey(privateKey)
.build()
.unseal(encryptedText);

but I'm getting this error:

java.security.GeneralSecurityException: cannot verify signature
    at com.google.crypto.tink.apps.paymentmethodtoken.PaymentMethodTokenRecipient.verify(PaymentMethodTokenRecipient.java:471)
    at com.google.crypto.tink.apps.paymentmethodtoken.PaymentMethodTokenRecipient.verifyIntermediateSigningKey(PaymentMethodTokenRecipient.java:545)
    at com.google.crypto.tink.apps.paymentmethodtoken.PaymentMethodTokenRecipient.verifyECV2(PaymentMethodTokenRecipient.java:411)
    at com.google.crypto.tink.apps.paymentmethodtoken.PaymentMethodTokenRecipient.unsealECV2(PaymentMethodTokenRecipient.java:375)
    at com.google.crypto.tink.apps.paymentmethodtoken.PaymentMethodTokenRecipient.unseal(PaymentMethodTokenRecipient.java:352)
    at com.test.googlepay.GooglepayApplication.main(GooglepayApplication.java:61)

I want a guide because I tried different approaches

本文标签: javaDecrypt direct GooglePay tokenStack Overflow