{"id":28576358,"url":"https://github.com/google-pay/payment-data-cryptography-dotnet","last_synced_at":"2025-06-10T23:40:18.309Z","repository":{"id":41119985,"uuid":"173940303","full_name":"google-pay/payment-data-cryptography-dotnet","owner":"google-pay","description":"Sample implementation of Google Pay Payment Data Cryptography in C#","archived":false,"fork":false,"pushed_at":"2022-07-13T03:34:51.000Z","size":54,"stargazers_count":29,"open_issues_count":4,"forks_count":19,"subscribers_count":17,"default_branch":"master","last_synced_at":"2024-03-27T10:06:29.820Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/google-pay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-05T12:14:06.000Z","updated_at":"2024-02-11T02:03:53.000Z","dependencies_parsed_at":"2022-09-01T11:31:45.408Z","dependency_job_id":null,"html_url":"https://github.com/google-pay/payment-data-cryptography-dotnet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google-pay%2Fpayment-data-cryptography-dotnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google-pay%2Fpayment-data-cryptography-dotnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google-pay%2Fpayment-data-cryptography-dotnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google-pay%2Fpayment-data-cryptography-dotnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/google-pay","download_url":"https://codeload.github.com/google-pay/payment-data-cryptography-dotnet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google-pay%2Fpayment-data-cryptography-dotnet/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259172148,"owners_count":22816514,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-10T23:40:15.419Z","updated_at":"2025-06-10T23:40:18.301Z","avatar_url":"https://github.com/google-pay.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Google Pay - payment data cryptography in C#\n\n## Overview\n\n.NET idiomatic library that performs the steps outlined in [Payment data cryptography](https://developers.google.com/pay/api/web/guides/resources/payment-data-cryptography).\nIt allows you to decrypt and verify a `PaymentMethodToken` object generated by\nthe Google Pay API. It supports versions `ECv1` and `ECv2`.\n\nInternally, it relies on [Bouncy Castle C#](https://www.bouncycastle.org/csharp/index.html)\nand has no other external dependencies.\n\n## Sample use\n\n### Decrypt payment messages\n```csharp\n// To use INSTANCE_TEST, set the parameter to true\nvar keyProvider = new GooglePay.PaymentDataCryptography.GoogleKeyProvider(false);\nvar parser = new GooglePay.PaymentDataCryptography.PaymentMethodTokenRecipient(\"merchant:YOUR_MERCHANT_ID\", keyProvider);\nparser.AddPrivateKey(PrivateKey1);\nparser.AddPrivateKey(PrivateKey2);\nstring decryptedMessage = parser.Unseal(encryptedMessage);\n```\n\n### Validate Pass callbacks:\n```csharp\nvar passCallbackValidator = new PassCallbackValidator();\nvar innerMessage = passCallbackValidator.Verify(\"YOUR_ISSUER_ID\", receivedCallbackMessage);\n```\n\n## Disclaimer\n\nThis is not an official Google product.\n\n[Tink](https://github.com/google/tink) is the library actively maintained and\nsupported by the Google Pay team. Using Tink to perform payment data\ncryptography for Google Pay is highly recommended.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle-pay%2Fpayment-data-cryptography-dotnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogle-pay%2Fpayment-data-cryptography-dotnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle-pay%2Fpayment-data-cryptography-dotnet/lists"}