Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Pay decryption in Go language #12

Open
issatayev opened this issue Jan 22, 2021 · 4 comments
Open

Google Pay decryption in Go language #12

issatayev opened this issue Jan 22, 2021 · 4 comments

Comments

@issatayev
Copy link

Currently I am implementing the Google Pay and stuck at the decryption part. I want to implement the Google Pay payment token decryption in Go language, but I couldn't find an example on how to use already generated private key with the Tink library. A private key is base64-encoded in PKCS tink-crypto/tink#8 format. In Google Pay documentation, there is an example in Java, where you can directly use a private key (https://developers.google.com/pay/api/processors/guides/implementation/using-tink). Below is an example:

String decryptedMessage = new PaymentMethodTokenRecipient.Builder() .fetchSenderVerifyingKeysWith( GooglePaymentsPublicKeysManager.INSTANCE_PRODUCTION) .recipientId("gateway:processorname") // This guide applies only to protocolVersion = ECv2 .protocolVersion("ECv2") // Multiple private keys can be added to support graceful // key rotations. .addRecipientPrivateKey(PrivateKey1) .addRecipientPrivateKey(PrivateKey2) .build() .unseal(encryptedMessage);

Can you please help me to figure out how to properly implement the decryption part? Is the only way is to work with keysets? If so, in order to decrypt using Tink, should I use hybrid decryption?

Sorry if it is a straightforward or basic question. Any examples/help/guidelines will be much appreciated.

@SarahChenJieyi
Copy link

Did you figure out how to decrypt with golang?

@zhumango
Copy link

zhumango commented Feb 2, 2022

I also ran into this problem, I can't find examples of how to do it, although I've read all the code in this library.
If there is someone who has implemented, please give an example

@tholenst
Copy link
Contributor

At the moment, we do not support this. This is considered a feature request for this.

@qoyanchoz
Copy link

qoyanchoz commented Jul 21, 2023

Hi!
Can anyone give feedback on whether tink is currently supported? If yes, can you please tell me how to properly decrypt Google Pay payload? Using Golang of course :)
Thanks!

@morambro morambro transferred this issue from tink-crypto/tink Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants