You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are doing the steps mentioned in this document but consistently receiving error for signature verification. Please advise.
Error: 'cannot verify signature'
What was the expected behavior?
Expectation is the encrypted payload signature should be verified and able to unseal using the private key.
However, it fails during signature verification.
@TestpublicvoidtestUnseal() throwsException {
// created using Google Pay API via GPAY button in JS// The value for "tokenizationData.token" is similar to the value in following example// https://developers.google.com/pay/api/web/guides/resources/payment-data-cryptography#exampleStringencryptedMessage = "...";
PaymentMethodTokenRecipientrecipient =
newPaymentMethodTokenRecipient.Builder()
.protocolVersion("ECv2")
.fetchSenderVerifyingKeysWith(GooglePaymentsPublicKeysManager.INSTANCE_TEST)
.recipientId("test") // encryptedMessage created using this merchant id
.addRecipientPrivateKey(googlePayPrivateKey)
.build();
StringdecryptedMessage = recipient.unseal(encryptedMessage); // Fails herelog.info("Decrypted Message: {}", decryptedMessage);
}
Can you tell us more about your development environment?
JDK 21
Springboot 3.2.2
Gradle wrapper 8.6
Private keys stored in AWS secrets manager which are fetched using spring.config.import
The root public key auto refresh instance is being evaluated in spring configuration during application bootup
@Configuration@Slf4jpublicclassAppConfigs {
@BeanpublicGooglePaymentsPublicKeysManagergooglePaymentsPublicKeysManager(@Value("${spring.profiles.active}") StringactiveProfile) {
log.info("Initializing GooglePaymentsPublicKeysManager based on profile: '{}'", activeProfile);
returnOptional.ofNullable(activeProfile)
.filter(Constants.PROD_PROFILE::equalsIgnoreCase)
.map(prod -> {
log.info("Initializing GooglePaymentsPublicKeysManager public key refresh for 'production'");
// Refresh the keys in the background for productionGooglePaymentsPublicKeysManager.INSTANCE_PRODUCTION.refreshInBackground();
returnGooglePaymentsPublicKeysManager.INSTANCE_PRODUCTION;
})
.orElseGet(() -> {
log.info("Initializing GooglePaymentsPublicKeysManager public key refresh for 'test'");
// Refresh the keys in the background for testGooglePaymentsPublicKeysManager.INSTANCE_TEST.refreshInBackground();
returnGooglePaymentsPublicKeysManager.INSTANCE_TEST;
});
}
}
Is there anything else you'd like to add?
A bit stuck at the moment as we are following the steps mentioned on the document.
Describe the bug:
https://developers.google.com/pay/api/web/guides/resources/payment-data-cryptography#using-tink
We are doing the steps mentioned in this document but consistently receiving error for signature verification. Please advise.
Error: 'cannot verify signature'
What was the expected behavior?
Expectation is the encrypted payload signature should be verified and able to unseal using the private key.
However, it fails during signature verification.
How can we reproduce the bug?
https://developers.google.com/pay/api/web/guides/resources/payment-data-cryptography#example
You will need to generate an encrypted message using the merchant id.
Sample request
Unit test
Do you have any debugging information?
Error stack trace
What version of Tink are you using?
1.10.0
Can you tell us more about your development environment?
JDK 21
Springboot 3.2.2
Gradle wrapper 8.6
Private keys stored in AWS secrets manager which are fetched using
spring.config.import
The root public key auto refresh instance is being evaluated in spring configuration during application bootup
Is there anything else you'd like to add?
A bit stuck at the moment as we are following the steps mentioned on the document.
References
The text was updated successfully, but these errors were encountered: