@Test public void testUnsealECV2() throws Exception { PaymentMethodTokenRecipient recipient = new PaymentMethodTokenRecipient.Builder() .protocolVersion(PaymentMethodTokenConstants.PROTOCOL_VERSION_EC_V2) .senderVerifyingKeys(GOOGLE_VERIFYING_PUBLIC_KEYS_JSON) .recipientId(RECIPIENT_ID) .addRecipientPrivateKey(MERCHANT_PRIVATE_KEY_PKCS8_BASE64) .build(); assertEquals(PLAINTEXT, recipient.unseal(sealECV2(PLAINTEXT))); }
private String unsealECV2(String sealedMessage) throws JSONException, GeneralSecurityException { JSONObject jsonMsg = new JSONObject(sealedMessage); validateECV2(jsonMsg); String signedMessage = verifyECV2(jsonMsg); String decryptedMessage = decrypt(signedMessage); validateMessage(decryptedMessage); return decryptedMessage; }
PaymentMethodTokenRecipient { private String unsealECV2(String sealedMessage) throws JSONException, GeneralSecurityException { JSONObject jsonMsg = new JSONObject(sealedMessage); validateECV2(jsonMsg); String signedMessage = verifyECV2(jsonMsg); String decryptedMessage = decrypt(signedMessage); validateMessage(decryptedMessage); return decryptedMessage; } }
PaymentMethodTokenRecipient { private String unsealECV2(String sealedMessage) throws JSONException, GeneralSecurityException { JSONObject jsonMsg = new JSONObject(sealedMessage); validateECV2(jsonMsg); String signedMessage = verifyECV2(jsonMsg); String decryptedMessage = decrypt(signedMessage); validateMessage(decryptedMessage); return decryptedMessage; } PaymentMethodTokenRecipient(
      String protocolVersion,
      List<SenderVerifyingKeysProvider> senderVerifyingKeysProviders,
      String senderId,
      List<ECPrivateKey> recipientPrivateKeys,
      List<PaymentMethodTokenRecipientKem> recipientKems,
      String recipientId); private  PaymentMethodTokenRecipient(Builder builder); }
PaymentMethodTokenRecipient { private String unsealECV2(String sealedMessage) throws JSONException, GeneralSecurityException { JSONObject jsonMsg = new JSONObject(sealedMessage); validateECV2(jsonMsg); String signedMessage = verifyECV2(jsonMsg); String decryptedMessage = decrypt(signedMessage); validateMessage(decryptedMessage); return decryptedMessage; } PaymentMethodTokenRecipient(
      String protocolVersion,
      List<SenderVerifyingKeysProvider> senderVerifyingKeysProviders,
      String senderId,
      List<ECPrivateKey> recipientPrivateKeys,
      List<PaymentMethodTokenRecipientKem> recipientKems,
      String recipientId); private  PaymentMethodTokenRecipient(Builder builder); String unseal(final String sealedMessage); }
PaymentMethodTokenRecipient { private String unsealECV2(String sealedMessage) throws JSONException, GeneralSecurityException { JSONObject jsonMsg = new JSONObject(sealedMessage); validateECV2(jsonMsg); String signedMessage = verifyECV2(jsonMsg); String decryptedMessage = decrypt(signedMessage); validateMessage(decryptedMessage); return decryptedMessage; } PaymentMethodTokenRecipient(
      String protocolVersion,
      List<SenderVerifyingKeysProvider> senderVerifyingKeysProviders,
      String senderId,
      List<ECPrivateKey> recipientPrivateKeys,
      List<PaymentMethodTokenRecipientKem> recipientKems,
      String recipientId); private  PaymentMethodTokenRecipient(Builder builder); String unseal(final String sealedMessage);  }