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

Extend documentation on thread safety #4

Open
fkohl04 opened this issue Nov 18, 2024 · 0 comments
Open

Extend documentation on thread safety #4

fkohl04 opened this issue Nov 18, 2024 · 0 comments
Assignees

Comments

@fkohl04
Copy link

fkohl04 commented Nov 18, 2024

Hey all,

my Team is using the Tink library as described in the Google Developer portal. The example code creates a fresh PaymentTokenRecipient to unseal an encrypted String:

String decryptedMessage =
    new PaymentMethodTokenRecipient.Builder()
    .fetchSenderVerifyingKeysWith(
        GooglePaymentsPublicKeysManager.INSTANCE_PRODUCTION)
    .recipientId("merchant:[YOUR MERCHANT ID]")
    // 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);

Is the implementation of PaymentMethodTokenRecipient thread safe so that it would be possible to reuse an instance and especially use one instance from multiple threads?

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

2 participants