@Test
public void testShouldFailIfVerifyingWithDifferentKeyECV2SigningOnly() throws Exception {

  JSONObject trustedKeysJson = new JSONObject(GOOGLE_VERIFYING_PUBLIC_KEYS_JSON);
  trustedKeysJson
      .getJSONArray("keys")
      .getJSONObject(INDEX_OF_GOOGLE_SIGNING_EC_V2_SIGNING_ONLY)
      .put("keyValue", ALTERNATE_PUBLIC_SIGNING_KEY);
  PaymentMethodTokenRecipient recipient =
      new PaymentMethodTokenRecipient.Builder()
          .protocolVersion(PaymentMethodTokenConstants.PROTOCOL_VERSION_EC_V2_SIGNING_ONLY)
          .senderVerifyingKeys(trustedKeysJson.toString())
          .recipientId(RECIPIENT_ID)
          .build();
  try {
    recipient.unseal(signECV2SigningOnly(PLAINTEXT));
    fail("Expected GeneralSecurityException");
  } catch (GeneralSecurityException e) {
    assertEquals("cannot verify signature", e.getMessage());
  }
}