-
Notifications
You must be signed in to change notification settings - Fork 6
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
Comments
Did you figure out how to decrypt with golang? |
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. |
At the moment, we do not support this. This is considered a feature request for this. |
Hi! |
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.
The text was updated successfully, but these errors were encountered: