{"id":30117296,"url":"https://github.com/jeds6391/nzcovidpass","last_synced_at":"2025-10-07T02:04:10.374Z","repository":{"id":45314899,"uuid":"427487716","full_name":"JedS6391/NzCovidPass","owner":"JedS6391","description":"Provides the ability to ability to verify New Zealand COVID Pass payloads in .NET.","archived":false,"fork":false,"pushed_at":"2021-12-21T21:31:51.000Z","size":191,"stargazers_count":2,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-14T12:01:49.478Z","etag":null,"topics":["covid-19","csharp","dotnet","nz","verification"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JedS6391.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-12T20:26:30.000Z","updated_at":"2021-12-21T21:31:54.000Z","dependencies_parsed_at":"2022-09-01T22:21:29.727Z","dependency_job_id":null,"html_url":"https://github.com/JedS6391/NzCovidPass","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/JedS6391/NzCovidPass","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JedS6391%2FNzCovidPass","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JedS6391%2FNzCovidPass/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JedS6391%2FNzCovidPass/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JedS6391%2FNzCovidPass/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JedS6391","download_url":"https://codeload.github.com/JedS6391/NzCovidPass/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JedS6391%2FNzCovidPass/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278708007,"owners_count":26031932,"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","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["covid-19","csharp","dotnet","nz","verification"],"created_at":"2025-08-10T10:40:57.636Z","updated_at":"2025-10-07T02:04:10.341Z","avatar_url":"https://github.com/JedS6391.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NZ COVID Pass\n\n[![nuget][nuget-image]][nuget-url]\n[![build][build-image]][build-url]\n[![code-coverage][code-coverage-image]][code-coverage-url]\n\n## About\n\nProvides the ability to ability to verify [New Zealand COVID Pass](https://nzcp.covid19.health.nz/) payloads in .NET.\n\n## Usage\n\n```cs\nvar services = new ServiceCollection();\n\nservices.AddMemoryCache();\nservices.AddNzCovidPassVerifier();\n\nvar provider = services.BuildServiceProvider();\n\nvar verifier = provider.GetRequiredService\u003cPassVerifier\u003e();\n\nvar result = await verifier.VerifyAsync(\"...\");\n\nif (result.HasSucceeded)\n{\n    // Pass successfully verified\n    Console.WriteLine($\"NZ COVID Pass subject details: {result.Pass.FamilyName}, {result.Pass.GivenName} - {result.Pass.DateOfBirth}\");\n}\nelse\n{    \n    // Invalid pass\n    Console.WriteLine($\"Verification failed: {string.Join(\", \", result.FailureReasons.Select(fr =\u003e fr.Code))}\");\n}\n```\n\nFull examples of usage can be found in the [demos](./demos/) folder.\n\n### Advanced usage\n\n#### Logging\n\nThe `PassVerifier` logs message via the `Microsoft.extensions.Logging.ILogger\u003cTCategoryName\u003e` abstraction. See the [.NET documentation](https://docs.microsoft.com/en-us/dotnet/core/extensions/logging?tabs=command-line) for more details.\n\n#### Customising verifier options\n\n```cs\nservices.AddNzCovidPassVerifier(options =\u003e\n{\n    var validIssuers = PassVerifierOptions.Defaults.ValidIssuers.ToHashSet();\n\n    // Add test issuer\n    validIssuers.Add(\"did:web:nzcp.covid19.health.nz\");\n\n    options.ValidIssuers = validIssuers;    \n});\n```\n\n#### Custom verification keys\n\nWith the default configuration, verification keys are resolved via HTTP from the DID document associated with the  issuer and key ID contained in the pass payload.\n\nIf you wish to use a static key (e.g. to support offline usage) or for testing purposes, a custom `IVerificationKeyProvider` can be registered:\n\n```cs\nservices.Replace(ServiceDescriptor.Singleton\u003cIVerificationKeyProvider, CustomVerificationKeyProvider\u003e());\n```\n\n## Development\n\nFollowing the instructions below to get started with the project in a local development environment.\n\n### Prerequisites\n\n- [.NET 6.0](https://dotnet.microsoft.com/download/dotnet/6.0)\n\n### Building\n\nAfter cloning the source code to a destination of your choice, run the following command to build the solution:\n\n```console\ndotnet build\n```\n\n### Tests\n\nThe test suite can be run using the following command:\n\n```console\ndotnet test\n```\n\n[nuget-image]: https://img.shields.io/nuget/v/NzCovidPass.Core?style=flat-square\n[nuget-url]: https://www.nuget.org/packages/NzCovidPass.Core\n[build-image]: https://img.shields.io/github/workflow/status/JedS6391/NzCovidPass/CI?style=flat-square\n[build-url]: https://github.com/JedS6391/NzCovidPass/actions/workflows/ci.yml\n[code-coverage-image]: https://img.shields.io/codecov/c/github/JedS6391/NzCovidPass?style=flat-square\n[code-coverage-url]: https://app.codecov.io/gh/JedS6391/NzCovidPass","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeds6391%2Fnzcovidpass","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeds6391%2Fnzcovidpass","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeds6391%2Fnzcovidpass/lists"}