public final class PaymentMethodTokenRecipient extends Object
This implementation only supports versions ECv1, ECv2 and ECv2SigningOnly.
PaymentMethodTokenRecipient recipient = new PaymentMethodTokenRecipient.Builder()
.fetchSenderVerifyingKeysWith(
GooglePaymentsPublicKeysManager.INSTANCE_PRODUCTION)
.recipientId(recipientId)
// Multiple recipient private keys can be added to support graceful key rotations
.addRecipientPrivateKey(recipientPrivateKey1)
.addRecipientPrivateKey(recipientPrivateKey2)
.build();
String ciphertext = ...;
String plaintext = recipient.unseal(ciphertext);
Recipients that store private keys in HSM can provide implementations of PaymentMethodTokenRecipientKem and configure Tink to use their custom code with PaymentMethodTokenRecipient.Builder.addRecipientKem(com.google.crypto.tink.apps.paymentmethodtoken.PaymentMethodTokenRecipientKem).
PaymentMethodTokenRecipient recipient = new PaymentMethodTokenRecipient.Builder()
.fetchSenderVerifyingKeysWith(
GooglePaymentsPublicKeysManager.INSTANCE_PRODUCTION)
.recipientId(recipientId)
.addRecipientKem(new MyPaymentMethodTokenRecipientKem())
.build();
String ciphertext = ...;
String plaintext = recipient.unseal(ciphertext);
| Modifier and Type | Class and Description |
|---|---|
static class |
PaymentMethodTokenRecipient.Builder
Builder for
PaymentMethodTokenRecipient. |
| Modifier and Type | Method and Description |
|---|---|
String |
unseal(String sealedMessage)
Unseal the given
sealedMessage by performing the necessary signature verification and
decryption (if required) steps based on the protocolVersion. |
public String unseal(String sealedMessage) throws GeneralSecurityException
sealedMessage by performing the necessary signature verification and
decryption (if required) steps based on the protocolVersion.GeneralSecurityException