tink-crypto / tink

Tink is a multi-language, cross-platform, open source library that provides cryptographic APIs that are secure, easy to use correctly, and hard(er) to misuse.
https://developers.google.com/tink
Apache License 2.0
13.47k stars 1.18k forks source link

java.security.GeneralSecurityException: cannot verify signature #716

Closed kevinnguyen8699 closed 11 months ago

kevinnguyen8699 commented 12 months ago

Hi everyone! I am on a ticket to decrypt google pay token. I used tink library and followed google documentation, but I always get cannot verify signature error.

at com.google.crypto.tink.apps.paymentmethodtoken.PaymentMethodTokenRecipient.verify(PaymentMethodTokenRecipient.java:486) at com.google.crypto.tink.apps.paymentmethodtoken.PaymentMethodTokenRecipient.verifyECV2(PaymentMethodTokenRecipient.java:419) at com.google.crypto.tink.apps.paymentmethodtoken.PaymentMethodTokenRecipient.unsealECV2(PaymentMethodTokenRecipient.java:378) at com.google.crypto.tink.apps.paymentmethodtoken.PaymentMethodTokenRecipient.unseal(PaymentMethodTokenRecipient.java:352) at com.google.crypto.tink.apps.paymentmethodtoken.Main.main(Main.java:19)

However, if I ignore the verification(https://github.com/tink-crypto/tink-java-apps/blob/main/paymentmethodtoken/src/main/java/com/google/crypto/tink/apps/paymentmethodtoken/PaymentMethodTokenRecipient.java#L409) it will successfully decrypt. Does anyone know what these errors mean?

jerrwy commented 7 months ago

@kevinnguyen8699 hi, kevin. Can you tell me how you eventually resolved it?