tink-crypto / tink-crypto/tink-java-apps

Extend documentation on thread safety

Open
#4 0 comments 0 reactions 1 assignee View on GitHub

@willinois is already working on this.

Since Nov 20, 2024.

Dominant language
Java
Stars
23
Forks
15
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.